//package com.stack.common.utils;
//
//import java.awt.image.BufferedImage;
//import java.io.*;
//import java.math.BigDecimal;
//import java.net.HttpURLConnection;
//import java.net.URL;
//import java.util.*;
//import java.util.concurrent.ConcurrentHashMap;
//import java.util.function.Function;
//import java.util.stream.Collectors;
//
//import com.aspose.cells.License;
//import com.aspose.cells.PdfSaveOptions;
//import com.emodor.attendance.constants.*;
//import com.emodor.attendance.entities.KeyValueForDate;
//import com.emodor.attendance.entities.company.CompanyDayDataPairDTO;
//import com.emodor.attendance.entities.dashboard.company.PeriodDataTrendDTO;
//import com.emodor.attendance.entities.dashboard.project.CategoryAttendanceDTO;
//import com.emodor.attendance.entities.dashboard.project.GroupAttendanceDTO;
//import com.emodor.attendance.entities.dashboard.project.ProjectCostAndWorkingDaysDTO;
//import com.emodor.attendance.entities.group.*;
//import com.emodor.attendance.entities.project.*;
//import com.emodor.attendance.service.attendance.AttendanceService;
//import com.emodor.attendance.service.attendance.CompanyAttendanceService;
//import com.emodor.attendance.service.company.CompanyCostService;
//import com.emodor.attendance.service.company.CompanyService;
//import com.emodor.attendance.entities.company.CompanyBaseDTO;
//import com.emodor.attendance.entities.worker.*;
//import com.emodor.attendance.export.ExportCompanySummary;
//import com.emodor.attendance.export.ExportProjectStatistic;
//import com.emodor.attendance.export.ExportProjectSummary;
//import com.emodor.attendance.service.dashboard.CompanyDashboardService;
//import com.emodor.attendance.service.dashboard.ProjectDashboardService;
//import com.emodor.attendance.service.project.ProjectCostService;
//import com.emodor.attendance.service.project.ProjectDistributionsService;
//import com.emodor.attendance.service.project.ProjectStatisticService;
//import com.emodor.attendance.service.worker.WorkerGroupService;
//import com.emodor.attendance.utils.ExcelToPDFUtil;
//import com.emodor.attendance.utils.FileUtility;
//import com.emodor.attendance.utils.Pdf2ImgUtil;
//import com.emodor.attendance.utils.ResourceCloseUtil;
//import org.apache.commons.io.IOUtils;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.dubbo.config.annotation.DubboReference;
//import org.apache.poi.hssf.usermodel.HSSFCellStyle;
//import org.apache.poi.hssf.util.HSSFColor;
//import org.apache.poi.ss.usermodel.*;
//import org.apache.poi.ss.util.CellRangeAddress;
//import org.apache.poi.util.Units;
//import org.apache.poi.xssf.usermodel.XSSFCellStyle;
//import org.apache.poi.xssf.usermodel.XSSFFont;
//import org.apache.poi.xssf.usermodel.XSSFRichTextString;
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.core.io.DefaultResourceLoader;
//import org.springframework.core.io.ResourceLoader;
//import org.springframework.stereotype.Component;
//
//import com.emodor.attendance.entities.user.SysUserDTO;
//import com.emodor.attendance.service.project.CompanyProjectService;
//import com.emodor.modules.utils.DateUtil;
//import com.emodor.modules.utils.MathUtil;
//
//import javax.imageio.ImageIO;
//
//@Component
//public class POIExcelUtil {
//
//	private final Logger logger = LoggerFactory.getLogger(getClass());
//
//	@DubboReference
//	private WorkerGroupService groupService;
//
//	@DubboReference
//	private CompanyProjectService projectService;
//
//	@DubboReference
//	private ProjectStatisticService projectStatisticService;
//
//	@DubboReference
//	private ProjectDistributionsService projectDistributionsService;
//
//	@DubboReference
//	private CompanyService companyService;
//
//	@DubboReference
//	private CompanyAttendanceService companyAttendanceService;
//
//	@DubboReference
//	private CompanyDashboardService companyDashboardService;
//
//	@DubboReference
//	private ProjectDashboardService projectDashboardService;
//
//	@DubboReference
//	private CompanyCostService companyCostService;
//
//	@DubboReference
//	private ProjectCostService projectCostService;
//
//
//	@DubboReference
//	private AttendanceService attendanceService;
//
//	private double formatMinutes2Hours(long minutes) {
//		if (minutes == 0) {
//			return 0;
//		}
//		if (minutes % 60 == 0) {
//			return minutes / 60;
//		}
//		double minutes2 = new Double(String.valueOf(minutes));
//		double hour = minutes2 / 60;
//		// 保留三位小数
//		BigDecimal b = new BigDecimal(hour);
//		double df = b.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
//		return df;
//	}
//
//
//	/**
//	 * 生成班组考勤报表(多班组主要生成zip)
//	 * @param groupId
//	 * @param startDate
//	 * @param endDate
//	 * @param output
//	 * @param fileName
//	 * @return
//	 * @throws FileNotFoundException
//	 * @throws IOException
//	 */
//	public File generateWorkersAttDetailsExcel(String waterMarkCompanyLogo,String groupId, String startDate, String endDate, String output,
//			String fileName) throws FileNotFoundException, IOException {
//
//		long start = System.currentTimeMillis();
//
//		XSSFWorkbook book = new XSSFWorkbook();
//
//		Map<String,Double> incomeMap = new ConcurrentHashMap<>();
//
//		createAttendanceSheetByGroupId(waterMarkCompanyLogo,book, "考勤记录表", groupId, startDate, endDate, incomeMap);
//
//		File newFile = new File(output + fileName);
//		try {
//			InputStream is = null;
//			FileOutputStream fos = new FileOutputStream(newFile);
//			book.write(fos);
//			fos.flush();
//			fos.close();
//		}catch(Exception e) {
//			logger.error("生成工资分配表压缩包失败",e);
//		}
//
//		long end = System.currentTimeMillis();
//
//		logger.info("完成生成工资分配表时间:------------------------" + (end - start)/1000 + "秒");
//
//		return newFile;
//
//	}
//
//
//
//	/**
//	 * 生成班组工资分配报表(多班组主要生成zip)
//	 * @param groupId
//	 * @param startDate
//	 * @param endDate
//	 * @param output
//	 * @param fileName
//	 * @return
//	 * @throws FileNotFoundException
//	 * @throws IOException
//	 */
//	public File generateWorkersGroupSalaryExcel(String waterMarkCompanyLogo,String groupId, String startDate, String endDate, String output,
//			String fileName) throws FileNotFoundException, IOException {
//
//		long start = System.currentTimeMillis();
//
//		XSSFWorkbook book = new XSSFWorkbook();
//
//		Map<String,Double> incomeMap = new ConcurrentHashMap<>();
//		Map<String, WorkerReportDTO> workerReportMap = new HashMap<>();
//		createAttendanceSalarySheetByGroupId(book, waterMarkCompanyLogo,"考勤记录表", groupId, startDate, endDate, incomeMap, workerReportMap);
//
//		// 生成工资表
//		createBankSheetByWorkerGroupId(book, waterMarkCompanyLogo,startDate, endDate, groupId,incomeMap, workerReportMap);
//
//		book.setSheetOrder("工资分配表", 0);
//		book.setSheetOrder("考勤记录表", 1);
//		book.setActiveSheet(0);
//
//		File newFile = new File(output + fileName);
//		try {
//			InputStream is = null;
//			FileOutputStream fos = new FileOutputStream(newFile);
//			book.write(fos);
//			fos.flush();
//			fos.close();
//		}catch(Exception e) {
//			logger.error("生成工资分配表压缩包失败",e);
//		}
//
//		long end = System.currentTimeMillis();
//
//		logger.info("完成生成工资分配表时间:------------------------" + (end - start)/1000 + "秒");
//
//		return newFile;
//
//	}
//
//	/**
//	 * 预览假数据
//	 *
//	 * @return
//	 */
//	private GroupSalaryReportDTO createData() {
//		GroupSalaryReportDTO groupSalaryReportDTO = new GroupSalaryReportDTO();
//		List<WorkerReportDTO> workerReportList = groupSalaryReportDTO.getWorkerReportList();
//		groupSalaryReportDTO.setProjectName("张三项目");
//		groupSalaryReportDTO.setGroupId("张三序号");
//		groupSalaryReportDTO.setGroupName("张三班组");
//		groupSalaryReportDTO.setSalaryRule("10001002");
//		WorkerReportDTO workerReportDTO = new WorkerReportDTO();
//		workerReportDTO.setWorkerId("张三工作id");
//		workerReportDTO.setWorkerCode("000001");
//		workerReportDTO.setName("张三");
//		workerReportDTO.setWorkingTimes(0);
//		workerReportDTO.setWorkingDays(0.0);
//		workerReportDTO.setOtWorkingTimes(0);
//		workerReportDTO.setOtWorkingDays(0.0);
//		workerReportDTO.setIncome(0.0);
//		workerReportDTO.setOtIncome(0.0);
//		workerReportDTO.setJoinDate(new Date());
//		Map<String, List<WorkerDataRecordDTO>> recordReportMap = workerReportDTO.getRecordReportMap();
//		workerReportDTO.setWorkerCategoryName("水电工");
//		workerReportDTO.setMobileNumber("11011011011");
//		workerReportDTO.setId("222");
//		List<WorkerDataRecordDTO> workerDataRecordDTOList = new ArrayList<>();
//		List<String> dayBetween = DateUtil.getDaysBetween("2022-09-01", "2022-10-01");
//		for (int a = 0; a < dayBetween.size(); a++) {
//			recordReportMap.put(dayBetween.get(a), workerDataRecordDTOList);
//		}
//		workerReportDTO.setRecordReportMap(recordReportMap);
//		workerReportList.add(workerReportDTO);
//		groupSalaryReportDTO.setWorkerReportList(workerReportList);
//		return groupSalaryReportDTO;
//	}
//
//	private void createAttendanceExportData(XSSFWorkbook book, String sheetName, String startDate, String endDate, Map<String, Double> incomeMap, List<AttendanceExportContentDTO> attendanceExportContentDTOList) {
//		GroupSalaryReportDTO reportDTO = createData();
//		//记录工种和工号是否隐藏
//		int countHide = 2;
//		int highCountHide = 5;
//		//查询出表格设置的内容
//		Map<String, AttendanceExportContentDTO> projectAttendanceExportColumnConfigDTOMap = attendanceExportContentDTOList.stream().collect(Collectors.toMap(AttendanceExportContentDTO::getModuleCode, Function.identity()));
//		//计算需要动态展示的横向列
//		countHide = buildAttendanceWideHide(projectAttendanceExportColumnConfigDTOMap, countHide);
//		//计算需要动态展示的纵向列
//		highCountHide = buildAttendanceHighHide(projectAttendanceExportColumnConfigDTOMap, highCountHide);
//
//		List<Date> dateList = new ArrayList<>();
//		DateUtil dateUtil = DateUtil.getInstance();
//		Date sDate = dateUtil.parseToDate2(startDate);
//		Date eDate = dateUtil.parseToDate2(endDate);
//
//		long days = dateUtil.diffDays(eDate, sDate);
//		for (int i = 0; i <= days; i++) {
//			Date date = dateUtil.getDateAfter(sDate, i);
//			dateList.add(date);
//		}
//
//		int addMultyAttendanceGroupCols = 0;
//		for (int i = 0; i < dateList.size(); i++) {
//
//			int maxAttendanceGroupCounts = 0;
//			// 出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//				addMultyAttendanceGroupCols = addMultyAttendanceGroupCols + maxAttendanceGroupCounts - 1;
//			}
//		}
//		String reportName = "云筑考勤统计表";
//		String createDate = "统计范围：" + startDate + " 至 " + endDate + "      制表时间：" + DateUtil.getInstance().getDateTime() + "(北京时间)";
//
//		Sheet sheet1 = book.createSheet(sheetName);
//
//		XSSFCellStyle title = book.createCellStyle();
//		XSSFFont reportFontFontTitle = book.createFont();
//		reportFontFontTitle.setFontName("黑体");
//		reportFontFontTitle.setFontHeightInPoints((short) 12);// 字号
//		reportFontFontTitle.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		title.setFont(reportFontFontTitle);
//		title.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		title.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		title.setWrapText(true);
//		title.setBorderBottom(BorderStyle.THIN);
//		title.setBorderLeft(BorderStyle.THIN);
//		title.setBorderRight(BorderStyle.THIN);
//		title.setBorderTop(BorderStyle.THIN);
//
//		XSSFCellStyle reportNameStyle = book.createCellStyle();
//		XSSFFont reportFontFont = book.createFont();
//		reportFontFont.setFontName("黑体");
//		reportFontFont.setFontHeightInPoints((short) 8);// 字号
//		reportFontFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		reportNameStyle.setFont(reportFontFont);
//		reportNameStyle.setAlignment(XSSFCellStyle.ALIGN_LEFT);// 左右居中
//		reportNameStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		reportNameStyle.setBorderBottom(BorderStyle.THIN);
//		reportNameStyle.setBorderLeft(BorderStyle.THIN);
//		reportNameStyle.setBorderRight(BorderStyle.THIN);
//		reportNameStyle.setBorderTop(BorderStyle.THIN);
//		reportNameStyle.setWrapText(true);
//
//		XSSFCellStyle style = book.createCellStyle();
//		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
//		XSSFFont titleFont = book.createFont();
//		titleFont.setFontName("黑体");
//		titleFont.setFontHeightInPoints((short) 16);// 字号
//		titleFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		style.setFont(titleFont);
//		style.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		style.setWrapText(true);// 自动换行
//		style.setBorderBottom(BorderStyle.THIN);
//		style.setBorderLeft(BorderStyle.THIN);
//		style.setBorderRight(BorderStyle.THIN);
//		style.setBorderTop(BorderStyle.THIN);
//
//
//		short titleHeigh = 300;
//		sheet1.setColumnWidth(0, 600);
//		// style.setRotation(short rotation);//单元格内容的旋转的角度
//		// 设置相应的行（初始从0开始）
//		Row row = sheet1.createRow(0);
//		row.setHeight((short) 880);
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		Cell cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue(reportName);
//		XSSFCellStyle leftStyle = getXssfCellStyle(book, XSSFFont.BOLDWEIGHT_NORMAL, XSSFCellStyle.ALIGN_LEFT);
//		cell.setCellStyle(leftStyle);
//
//		row.setHeight((short) 380);
//		// 2022/3/18 业务代码写多了，人也木讷了。对象参数的传递，是指针copy。
//		// cell传参，相当于cell1和cell2都指向了同个对象。
////        Cell titleRightCell = createCells(row, cell, 1 + countHide, title);
//
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
////        cell = row.createCell(titleRightCell.getColumnIndex() + 1);
//
//		cell.setCellStyle(title);
//		Cell finalCell=createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, title);
//
//		int topLeftLogoCell = cell.getColumnIndex();
//
//
//		row = sheet1.createRow(1);
//		cell = row.createCell(0);
//		row.setHeight(titleHeigh);
//		cell.setCellValue(createDate);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, reportNameStyle);
//
//		row = sheet1.createRow(2);
//		row.setHeight(titleHeigh);
//		cell = row.createCell(0);
//		cell.setCellValue("项目：" + reportDTO.getProjectName() + "   班组：" + reportDTO.getGroupName() + "   劳务公司：张三劳务公司");
//		cell.setCellStyle(reportNameStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, reportNameStyle);
//
//		row = sheet1.createRow(3);
//		row.setHeight((short) 1449);
//		cell = row.createCell(0);
//
//
//		String minutes = "30分钟";
//		if (reportDTO != null) {
//			if (EmodorDataDictConstant.SALARY_TYPE_ONE_MINUTE.equals(reportDTO.getSalaryRule())) {
//				minutes = "1分钟";
//			} else if (EmodorDataDictConstant.SALARY_TYPE_HALF_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "30分钟";
//			} else if (EmodorDataDictConstant.SALART_TYPE_ONE_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "60分钟";
//			}
//		}
//
//		//创建字体
//		XSSFFont ftRed = book.createFont();
//		ftRed.setColor(HSSFColor.RED.index);
//		ftRed.setFontName("黑体");
//		ftRed.setFontHeightInPoints((short) 8);// 字号
//		ftRed.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		String descripion = "说明:\r\n (1) 出勤标准8h/d表示出勤8个小时算1个工\r\n (2) 工时扣除迟到早退时间\r\n (3) 迟到早退时间取整，最小单位为&minutes&\r\n (4) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//				" \r\n (5) ■管理员修改";
//		if (reportDTO != null && SalaryRuleType.SALART_TYPE_ONE_CLICK.getType().equals(reportDTO.getSalaryRule())) {
//			descripion = "说明:\r\n (1) 出勤标准打卡一次算1个工\r\n (2) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//					" \r\n (3) ■管理员修改";
//		}
//
//		descripion = descripion.replace("&minutes&", minutes);
//		XSSFRichTextString richString = new XSSFRichTextString(descripion);
//		richString.applyFont(descripion.indexOf("■"), descripion.indexOf("■") + 1, ftRed);
//		XSSFFont ftB = book.createFont();
//		ftB.setFontName("黑体");
//		ftB.setFontHeightInPoints((short) 8);// 字号
//		ftB.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		richString.applyFont(descripion.indexOf("■") + 1, descripion.length(), ftB);
//		cell.setCellValue(richString);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, reportNameStyle);
//
//
//		XSSFCellStyle cellStyle = book.createCellStyle();
//		cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		cellStyle.setWrapText(true);
//		cellStyle.setBorderBottom(BorderStyle.THIN);
//		cellStyle.setBorderLeft(BorderStyle.THIN);
//		cellStyle.setBorderRight(BorderStyle.THIN);
//		cellStyle.setBorderTop(BorderStyle.THIN);
//		XSSFFont cellFont = book.createFont();
//		cellFont.setFontHeightInPoints((short) 6);// 字号
//		cellStyle.setFont(cellFont);
//
//		row = sheet1.createRow(4);
//		cell = row.createCell(0);
//		cell.setCellValue("序号");
//		cell.setCellStyle(cellStyle);
//
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, cellStyle);
//
//
//
//		cell = row.getCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("姓名");
//		cell.setCellStyle(cellStyle);
//
//
//		if (projectAttendanceExportColumnConfigDTOMap.get("007").getIsHide().equals("00")) {
//			cell = row.getCell(cell.getColumnIndex() + 1);
//			cell.setCellValue("工号");
//			cell.setCellStyle(cellStyle);
//		}
//
//		if (projectAttendanceExportColumnConfigDTOMap.get("006").getIsHide().equals("00")) {
//			cell = row.getCell(cell.getColumnIndex() + 1);
//			cell.setCellValue("工种");
//			cell.setCellStyle(cellStyle);
//		}
//
//		cell = row.getCell(cell.getColumnIndex() + 1);
////        sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		cell = row.getCell(1 + countHide + dateList.size());
//		cell.setCellValue("合计工时(小时)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.getCell(2 + countHide + dateList.size());
//		cell.setCellValue("合计工天(工)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.getCell(3 + countHide + dateList.size());
//		cell.setCellValue("工人签名");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.getCell(4 + countHide + dateList.size());
//		cell.setCellValue("备注");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 600);
//
//
//
//		// 日期左边单元格列数
////        int leftDateColNumbers = 5;
//		row = sheet1.createRow(5);
//		row.setHeight((short) 450);
//		cell = row.createCell(0);
//		cell.setCellStyle(cellStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, cellStyle);
//		int additionalCols = 0;
//		Map<Date, Integer> attendanceGroupCountsMap = new HashMap<>();
//		for (int i = 0; i < dateList.size(); i++) {
//			cell = row.getCell(countHide + 1 + i);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//			String dateTime = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_SIMPLEFORMAT4);
//			cell.setCellValue(dateTime.substring(6));
//			cell.setCellStyle(cellStyle);
//
//			int maxAttendanceGroupCounts = 0;
//
//			if (maxAttendanceGroupCounts == 0) {
//				// 至少需要创建一列
//				maxAttendanceGroupCounts = 1;
//			}
//			attendanceGroupCountsMap.put(dateList.get(i), maxAttendanceGroupCounts);
//			// 出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//
//				int dateCounts = 1;
//				while (dateCounts < maxAttendanceGroupCounts) {
//					cell = row.createCell(cell.getColumnIndex() + 1);
//					sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//					cell.setCellStyle(cellStyle);
//					dateCounts++;
//				}
//				sheet1.addMergedRegion(new CellRangeAddress(4, 4, 5 + i + additionalCols,
//						5 + i + additionalCols + maxAttendanceGroupCounts - 1));
//				additionalCols = additionalCols + maxAttendanceGroupCounts - 1;
//			}
//		}
//
//
//		//先填充第一个月份数据
//		row = sheet1.getRow(4);
//		cell = row.createCell(1 + countHide);
//		String firstMonth = DateUtil.getInstance().getDateTime(dateList.get(0), DateUtil.DEFAULT_DATETIME_FORMAT10).substring(0, 3);
//		String substring1 = firstMonth.substring(0, 1);
//		firstMonth=substring1.equals("0")?firstMonth.substring(1,3):firstMonth;
//		cell.setCellValue(firstMonth);
//		cell.setCellStyle(cellStyle);
//		String firstDate = DateUtil.getInstance().getDateTime(dateList.get(0), "d");
//		int daysOfMonth = dateUtil.getDaysOfMonth(dateList.get(0));
//		int day = daysOfMonth - Integer.parseInt(firstDate);
//		if (dateList.size() > day) {
//			//合并第一各月份
//			if (day > 0) {
//				sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide, 1 + countHide + day));
//			}
//		} else {
//			if (dateList.size() > 1) {
//				sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide, 1 + countHide + dateList.size() - 1));
//			}
//		}
//
//
//
//		for (int a = 0; a < dateList.size(); a++) {
//
//			String dateTime = DateUtil.getInstance().getDateTime(dateList.get(a), DateUtil.DEFAULT_DATETIME_FORMAT10);
//			String substring = dateTime.substring(0, 3);
//			String substring2 = substring.substring(0, 1);
//			substring=substring2.equals("0")?substring.substring(1,3):substring;
//			//进入下一个月得一号
//			if (!substring.equals(firstMonth) && dateTime.contains("01日")) {
//				//
//				//获取当前月得最大天数
//				int dayOfMonth = dateUtil.getDaysOfMonth(dateList.get(a));
//				cell = row.createCell(1 + countHide + a);
//				cell.setCellValue(substring);
//				cell.setCellStyle(cellStyle);
//				if (dayOfMonth + a < dateList.size()) {
//					sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide + a, 1 + countHide + dayOfMonth + a - 1));
//				} else {
//					if (1 + countHide + a != countHide + dateList.size()) {
//						sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide + a, countHide + dateList.size() + additionalCols));
//					}
//				}
//			}
//		}
//
//
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 0, countHide));
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 1 + countHide, countHide + dateList.size() + 4 + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(1, 1, 0, countHide + 4 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(2, 2, 0, countHide + 4 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(3, 3, 0, countHide + 4 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 0, 0));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 1, 1));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 2, 2));
//		if (countHide == 4) {
//			sheet1.addMergedRegion(new CellRangeAddress(4, 5, 3, 3));
//			sheet1.addMergedRegion(new CellRangeAddress(4, 5, 4, 4));
//		}
//		if (countHide == 3) {
//			sheet1.addMergedRegion(new CellRangeAddress(4, 5, 3, 3));
//		}
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 1 + countHide + dateList.size(), 1 + countHide + dateList.size()));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 2 + countHide + dateList.size(), 2 + countHide + dateList.size()));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 3 + countHide + dateList.size(), 3 + countHide + dateList.size()));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 4 + countHide + dateList.size(), 4 + countHide + dateList.size() + additionalCols));
//
//
////        sheet1.addMergedRegion(new CellRangeAddress(4, 5, 8 + dateList.size()+additionalCols, 8 + dateList.size()+additionalCols));
//
//
//		//  2022年3月18日
//		// =================================================
//		fillExcelLogo(book, null, sheet1, finalCell, sheet1.getRow(0), topLeftLogoCell);
//		// =================================================
//
//		sheet1.getRow(1).getCell(0).setCellStyle(reportNameStyle);
//		sheet1.getRow(2).getCell(0).setCellStyle(reportNameStyle);
//		sheet1.getRow(3).getCell(0).setCellStyle(reportNameStyle);
//
//		List<WorkerReportDTO> workerList = reportDTO.getWorkerReportList();
//		//组装考勤数据
//		buildAttendanceData(workerList,projectAttendanceExportColumnConfigDTOMap,incomeMap,cell,row,sheet1,book,dateList,countHide,highCountHide,attendanceGroupCountsMap,additionalCols,addMultyAttendanceGroupCols);
//
//	}
//
//
//
//
//
//
//	public String generateAttendanceExportData(String startDate, String endDate, String output, List<AttendanceExportContentDTO> attendanceExportContentDTOList) throws Exception {
//		long start = System.currentTimeMillis();
//
//
//		XSSFWorkbook book = new XSSFWorkbook();
//		String fileName = UUID.randomUUID().toString().substring(0,32)+ "考勤统计表.xlsx";
//		String pdfName = UUID.randomUUID().toString().substring(0,32)+ "考勤统计表.pdf";
//		String pngName = UUID.randomUUID().toString().substring(0,32) + "考勤统计表.png";
//		Map<String, Double> incomeMap = new HashMap<>();
//		createAttendanceExportData(book, "考勤记录表", startDate, endDate, incomeMap, attendanceExportContentDTOList);
//		File newFile = new File(output + File.separator + fileName);
//		String imageStr = null;
//		File pdfFile=null;
//		FileOutputStream fos=null;
//		FileInputStream excelStream=null;
//		FileOutputStream fileOS=null;
//		File pngFile=null;
//		try {
//			ResourceLoader resourceLoader=new DefaultResourceLoader();
//			String location= "/license.xml";
//			//获取resource包下的Aspose.Excel.lic文件
//			InputStream inputStream = resourceLoader.getResource(location).getInputStream();
//			License aposeLic = new License();
//			aposeLic.setLicense(inputStream);
//			fos = new FileOutputStream(newFile);
//			book.write(fos);
//			pdfFile = new File(output + File.separator + pdfName); // 输出路径
//			excelStream = new FileInputStream(newFile.getAbsolutePath());
//			com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(excelStream);// excel路径，这里是先把数据放进缓存表里，然后把缓存表转化成PDF
//			fileOS = new FileOutputStream(pdfFile);
//			PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
//			pdfSaveOptions.setOnePagePerSheet(true);//参数true把内容放在一张PDF页面上；
//			wb.save(fileOS, pdfSaveOptions);
//			pngFile = new File(output + File.separator + pngName);
//			Pdf2ImgUtil.pdfToImageLast(pdfFile.getPath(), pngFile, 128);
//			imageStr = ExcelToPDFUtil.getImageStr(pngFile.getAbsolutePath());
//			return "data:image/png;base64," + imageStr.replaceAll("\r|\n", "");
//		} catch (Exception e) {
//			logger.error("生成班组考勤统计表失败", e);
//		} finally {
//			if (fos != null) {
//				fos.close();
//			}
//			if (excelStream != null) {
//				excelStream.close();
//			}
//			if (fileOS != null) {
//				fileOS.close();
//			}
//			//删除临时文件
//			pdfFile.delete();
//			newFile.delete();
//			pngFile.delete();
//		}
//		long end = System.currentTimeMillis();
//
//		logger.info("完成生成班组考勤统计表时间:{}秒", (end - start) / 1000);
//
//		return null;
//	}
//
//	/**
//	 * 根据班组id生成excel表
//	 *
//	 * @param book
//	 * @param sheetName
//	 * @param waterMarkCompanyLogo
//	 * @param groupId
//	 * @param startDate
//	 * @param endDate
//	 * @param incomeMap
//	 * @param projectIds
//	 */
//	private void createAttendanceSheetByProject(XSSFWorkbook book, String sheetName, String waterMarkCompanyLogo, String groupId, String startDate,
//												String endDate, Map<String, Double> incomeMap, List<String> projectIds) {
//		GroupSalaryReportDTO reportDTO = groupService.getGroupSalaryReport(groupId, startDate, endDate);
//		String laborCompanyName = groupService.getGroupLaborCompanyName(groupId);
//		String contractorName = groupService.getGroupProjectContractorName(groupId);
//		String companyName = groupService.getCompanyNameByGroupId(groupId);
//		//记录工种和工号是否隐藏
//		int countHide = 2;
//		int highCountHide = 5;
//		//查询出表格设置的内容
//		ProjectAttendanceExportColumnConfigDTO attendanceContentList = projectService.getAttendanceContentList(projectIds, null, null, null);
//		Map<String, AttendanceExportContentDTO> projectAttendanceExportColumnConfigDTOMap = attendanceContentList.getAttendanceExportContentDTOList().stream().collect(Collectors.toMap(AttendanceExportContentDTO::getModuleCode, Function.identity()));
//		//计算需要动态展示的横向列
//		countHide = buildAttendanceWideHide(projectAttendanceExportColumnConfigDTOMap, countHide);
//		//计算需要动态展示的纵向列
//		highCountHide = buildAttendanceHighHide(projectAttendanceExportColumnConfigDTOMap, highCountHide);
//
//		List<Date> dateList = new ArrayList<>();
//		DateUtil dateUtil = DateUtil.getInstance();
//		Date sDate = dateUtil.parseToDate2(startDate);
//		Date eDate = dateUtil.parseToDate2(endDate);
//
//		long days = dateUtil.diffDays(eDate, sDate);
//		for (int i = 0; i <= days; i++) {
//			Date date = dateUtil.getDateAfter(sDate, i);
//			dateList.add(date);
//		}
//
//		//  yyyy-MM
//		//  统计各月份因多个考勤组而新增的列数
//		Map<String, Integer> yearMonthAddAttendanceGroupCountMap = new HashMap<>();
//		//  新增总数
//		int addMultyAttendanceGroupCols = 0;
//		for (int i = 0; i < dateList.size(); i++) {
//			int maxAttendanceGroupCounts = groupService.getMaxAttendanceGroupCountsByGroupIdAndRecordDate(groupId,
//					DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT));
//			// 出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//				String yearMonth = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATETIME_FORMAT10);
//				String substring1 = yearMonth.substring(0, 1);
//				yearMonth=substring1.equals("0")?yearMonth.substring(1,3):yearMonth;
//				if (yearMonthAddAttendanceGroupCountMap.get(yearMonth) != null) {
//					yearMonthAddAttendanceGroupCountMap.put(yearMonth,yearMonthAddAttendanceGroupCountMap.get(yearMonth) + maxAttendanceGroupCounts - 1);
//				} else {
//					yearMonthAddAttendanceGroupCountMap.put(yearMonth,maxAttendanceGroupCounts - 1);
//				}
//				addMultyAttendanceGroupCols = addMultyAttendanceGroupCols + maxAttendanceGroupCounts - 1;
//			}
//		}
//		String reportName = "云筑考勤统计表";
//		String createDate = "统计范围：" + startDate + " 至 " + endDate + "      制表时间：" + DateUtil.getInstance().getDateTime() + "(北京时间)";
//
//		Sheet sheet1 = book.createSheet(sheetName);
//
//		XSSFCellStyle title = book.createCellStyle();
//		XSSFFont reportFontFontTitle = book.createFont();
//		reportFontFontTitle.setFontName("黑体");
//		reportFontFontTitle.setFontHeightInPoints((short) 12);// 字号
//		reportFontFontTitle.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		title.setFont(reportFontFontTitle);
//		title.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		title.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		title.setWrapText(true);
//		title.setBorderBottom(BorderStyle.THIN);
//		title.setBorderLeft(BorderStyle.THIN);
//		title.setBorderRight(BorderStyle.THIN);
//		title.setBorderTop(BorderStyle.THIN);
//
//		XSSFCellStyle reportNameStyle = book.createCellStyle();
//		XSSFFont reportFontFont = book.createFont();
//		reportFontFont.setFontName("黑体");
//		reportFontFont.setFontHeightInPoints((short) 8);// 字号
//		reportFontFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		reportNameStyle.setFont(reportFontFont);
//		reportNameStyle.setAlignment(XSSFCellStyle.ALIGN_LEFT);// 左右居中
//		reportNameStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		reportNameStyle.setBorderBottom(BorderStyle.THIN);
//		reportNameStyle.setBorderLeft(BorderStyle.THIN);
//		reportNameStyle.setBorderRight(BorderStyle.THIN);
//		reportNameStyle.setBorderTop(BorderStyle.THIN);
//		reportNameStyle.setWrapText(true);
//
//		XSSFCellStyle style = book.createCellStyle();
//		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
//		XSSFFont titleFont = book.createFont();
//		titleFont.setFontName("黑体");
//		titleFont.setFontHeightInPoints((short) 16);// 字号
//		titleFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		style.setFont(titleFont);
//		style.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		style.setWrapText(true);// 自动换行
//		style.setBorderBottom(BorderStyle.THIN);
//		style.setBorderLeft(BorderStyle.THIN);
//		style.setBorderRight(BorderStyle.THIN);
//		style.setBorderTop(BorderStyle.THIN);
//
//
//		short titleHeigh = 300;
//		sheet1.setColumnWidth(0, 600);
//		// style.setRotation(short rotation);//单元格内容的旋转的角度
//		// 设置相应的行（初始从0开始）
//		Row row = sheet1.createRow(0);
//		row.setHeight((short) 880);
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		Cell cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue(reportName);
//		XSSFCellStyle leftStyle = getXssfCellStyle(book, XSSFFont.BOLDWEIGHT_NORMAL, XSSFCellStyle.ALIGN_LEFT);
//		cell.setCellStyle(leftStyle);
//
//		row.setHeight((short) 380);
//		// 2022/3/18 业务代码写多了，人也木讷了。对象参数的传递，是指针copy。
//		// cell传参，相当于cell1和cell2都指向了同个对象。
////        Cell titleRightCell = createCells(row, cell, 1 + countHide, title);
//
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
////        cell = row.createCell(titleRightCell.getColumnIndex() + 1);
//
//		cell.setCellStyle(title);
//		Cell finalCell=createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, title);
//
//		int topLeftLogoCell = cell.getColumnIndex();
//
//
//		row = sheet1.createRow(1);
//		cell = row.createCell(0);
//		row.setHeight(titleHeigh);
//		cell.setCellValue(createDate);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, reportNameStyle);
//
//		row = sheet1.createRow(2);
//		row.setHeight(titleHeigh);
//		cell = row.createCell(0);
//		cell.setCellValue("项目：" + reportDTO.getProjectName() + "   班组：" + reportDTO.getGroupName() + "   劳务公司：" + (StringUtils.isNotBlank(laborCompanyName) ? laborCompanyName : StringUtils.isNotBlank(contractorName) ? contractorName : companyName));
//		cell.setCellStyle(reportNameStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, reportNameStyle);
//
//		row = sheet1.createRow(3);
//		row.setHeight((short) 1449);
//		cell = row.createCell(0);
//
//
//		String minutes = "30分钟";
//		if (reportDTO != null) {
//			if (EmodorDataDictConstant.SALARY_TYPE_ONE_MINUTE.equals(reportDTO.getSalaryRule())) {
//				minutes = "1分钟";
//			} else if (EmodorDataDictConstant.SALARY_TYPE_HALF_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "30分钟";
//			} else if (EmodorDataDictConstant.SALART_TYPE_ONE_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "60分钟";
//			}
//		}
//
//		//创建字体
//		XSSFFont ftRed = book.createFont();
//		ftRed.setColor(HSSFColor.RED.index);
//		ftRed.setFontName("黑体");
//		ftRed.setFontHeightInPoints((short) 8);// 字号
//		ftRed.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		String descripion = "说明:\r\n (1) 出勤标准8h/d表示出勤8个小时算1个工\r\n (2) 工时扣除迟到早退时间\r\n (3) 迟到早退时间取整，最小单位为&minutes&\r\n (4) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//				" \r\n (5) ■管理员修改";
//		if (reportDTO != null && SalaryRuleType.SALART_TYPE_ONE_CLICK.getType().equals(reportDTO.getSalaryRule())) {
//			descripion = "说明:\r\n (1) 出勤标准打卡一次算1个工\r\n (2) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//					" \r\n (3) ■管理员修改";
//		}
//
//		descripion = descripion.replace("&minutes&", minutes);
//		XSSFRichTextString richString = new XSSFRichTextString(descripion);
//		richString.applyFont(descripion.indexOf("■"), descripion.indexOf("■") + 1, ftRed);
//		XSSFFont ftB = book.createFont();
//		ftB.setFontName("黑体");
//		ftB.setFontHeightInPoints((short) 8);// 字号
//		ftB.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		richString.applyFont(descripion.indexOf("■") + 1, descripion.length(), ftB);
//		cell.setCellValue(richString);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, reportNameStyle);
//
//
//		XSSFCellStyle cellStyle = book.createCellStyle();
//		cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		cellStyle.setWrapText(true);
//		cellStyle.setBorderBottom(BorderStyle.THIN);
//		cellStyle.setBorderLeft(BorderStyle.THIN);
//		cellStyle.setBorderRight(BorderStyle.THIN);
//		cellStyle.setBorderTop(BorderStyle.THIN);
//		XSSFFont cellFont = book.createFont();
//		cellFont.setFontHeightInPoints((short) 6);// 字号
//		cellStyle.setFont(cellFont);
//
//		row = sheet1.createRow(4);
//		cell = row.createCell(0);
//		cell.setCellValue("序号");
//		cell.setCellStyle(cellStyle);
//
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, cellStyle);
//
//
//
//		cell = row.getCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("姓名");
//		cell.setCellStyle(cellStyle);
//
//
//		if (projectAttendanceExportColumnConfigDTOMap.get("007").getIsHide().equals("00")) {
//			cell = row.getCell(cell.getColumnIndex() + 1);
//			cell.setCellValue("工号");
//			cell.setCellStyle(cellStyle);
//		}
//
//		if (projectAttendanceExportColumnConfigDTOMap.get("006").getIsHide().equals("00")) {
//			cell = row.getCell(cell.getColumnIndex() + 1);
//			cell.setCellValue("工种");
//			cell.setCellStyle(cellStyle);
//		}
//
//		cell = row.getCell(cell.getColumnIndex() + 1);
////        sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		cell = row.getCell(1 + countHide + dateList.size() + addMultyAttendanceGroupCols);
//		cell.setCellValue("合计工时(小时)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.getCell(2 + countHide + dateList.size() + addMultyAttendanceGroupCols);
//		cell.setCellValue("合计工天(工)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.getCell(3 + countHide + dateList.size() + addMultyAttendanceGroupCols);
//		cell.setCellValue("工人签名");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.getCell(4 + countHide + dateList.size() + addMultyAttendanceGroupCols);
//		cell.setCellValue("备注");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 600);
//
//
//
//		// 日期左边单元格列数
////        int leftDateColNumbers = 5;
//		row = sheet1.createRow(5);
//		row.setHeight((short) 450);
//		cell = row.createCell(0);
//		cell.setCellStyle(cellStyle);
//		createCells(row, cell, countHide + 4 + dateList.size() + addMultyAttendanceGroupCols, cellStyle);
//		int additionalCols = 0;
//		Map<Date, Integer> attendanceGroupCountsMap = new HashMap<>();
//		for (int i = 0; i < dateList.size(); i++) {
//			cell = row.getCell(countHide + 1 + i + additionalCols);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//			String dateTime = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_SIMPLEFORMAT4);
//			cell.setCellValue(dateTime.substring(6));
//			cell.setCellStyle(cellStyle);
//
//			int maxAttendanceGroupCounts = groupService.getMaxAttendanceGroupCountsByGroupIdAndRecordDate(groupId,
//					DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT));
//
//			if (maxAttendanceGroupCounts == 0) {
//				// 至少需要创建一列
//				maxAttendanceGroupCounts = 1;
//			}
//			attendanceGroupCountsMap.put(dateList.get(i), maxAttendanceGroupCounts);
//			// 出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//				int dateCounts = 1;
//				while (dateCounts < maxAttendanceGroupCounts) {
//					cell = row.getCell(cell.getColumnIndex() + 1);
//					sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//					cell.setCellStyle(cellStyle);
//					dateCounts++;
//				}
//				//判断是第几行的范围开始合并的
//				sheet1.addMergedRegion(new CellRangeAddress(5, 5, 1 + countHide + i + additionalCols,
//						1 + countHide + i + additionalCols + maxAttendanceGroupCounts - 1));
//				additionalCols = additionalCols + maxAttendanceGroupCounts - 1;
//			}
//		}
//
//
//		//先填充第一个月份数据
//		row = sheet1.getRow(4);
//		cell = row.getCell(1 + countHide);
//		String firstMonth = DateUtil.getInstance().getDateTime(dateList.get(0), DateUtil.DEFAULT_DATETIME_FORMAT10).substring(0, 3);
//		String substring1 = firstMonth.substring(0, 1);
//		firstMonth=substring1.equals("0")?firstMonth.substring(1,3):firstMonth;
//		cell.setCellValue(firstMonth);
//		cell.setCellStyle(cellStyle);
//		//计算出到下一个月份所需天数  1.1-3.1 1.30
//		Integer integer = yearMonthAddAttendanceGroupCountMap.get(firstMonth);
//		integer = integer == null ? 0 : integer;
//		String firstDate = DateUtil.getInstance().getDateTime(dateList.get(0), "d");
//		int daysOfMonth = dateUtil.getDaysOfMonth(dateList.get(0));
//		int day = daysOfMonth - Integer.parseInt(firstDate);
//		if (dateList.size() > day) {
//			if (day > 0) {
//				//合并第一各月份
//				sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide, 1 + countHide + day + integer));
//			}
//		} else {
//			if (dateList.size() > 1) {
//				sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide, 1 + countHide + dateList.size() - 1 + integer));
//			}
//		}
//
//
//		for (int a = 0; a < dateList.size(); a++) {
//
//			String dateTime = DateUtil.getInstance().getDateTime(dateList.get(a), DateUtil.DEFAULT_DATETIME_FORMAT10);
//			String substring = dateTime.substring(0, 3);
//			String substring2 = substring.substring(0, 1);
//			substring = substring2.equals("0") ? substring.substring(1, 3) : substring;
//			//进入下一个月得一号
//			if (!substring.equals(firstMonth) && dateTime.contains("01日")) {
//				//
//				Integer integer1 = yearMonthAddAttendanceGroupCountMap.get(substring);
//				integer1 = integer1 == null ? 0 : integer1;
//				//获取当前月得最大天数
//				int dayOfMonth = dateUtil.getDaysOfMonth(dateList.get(a));
//				cell = row.getCell(1 + countHide + a+integer);
//				cell.setCellValue(substring);
//				cell.setCellStyle(cellStyle);
//				if (dayOfMonth + a < dateList.size()) {
//					sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide + a + integer, 1 + countHide + dayOfMonth + a - 1 + integer1));
//				} else {
//					if (1 + countHide + a != countHide + dateList.size()) {
//						sheet1.addMergedRegion(new CellRangeAddress(4, 4, 1 + countHide + a + integer, countHide + dateList.size() + additionalCols));
//					}
//				}
//			}
//		}
//
//
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 0, countHide));
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 1 + countHide, countHide + dateList.size() + 4 + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(1, 1, 0, countHide + 4 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(2, 2, 0, countHide + 4 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(3, 3, 0, countHide + 4 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 0, 0));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 1, 1));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 2, 2));
//		if (countHide == 4) {
//			sheet1.addMergedRegion(new CellRangeAddress(4, 5, 3, 3));
//			sheet1.addMergedRegion(new CellRangeAddress(4, 5, 4, 4));
//		}
//		if (countHide == 3) {
//			sheet1.addMergedRegion(new CellRangeAddress(4, 5, 3, 3));
//		}
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 1 + countHide + dateList.size() + additionalCols, 1 + countHide + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 2 + countHide + dateList.size() + additionalCols, 2 + countHide + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 3 + countHide + dateList.size() + additionalCols, 3 + countHide + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(4, 5, 4 + countHide + dateList.size() + additionalCols, 4 + countHide + dateList.size() + additionalCols));
//
//
////        sheet1.addMergedRegion(new CellRangeAddress(4, 5, 8 + dateList.size()+additionalCols, 8 + dateList.size()+additionalCols));
//
//
//		//  2022年3月18日
//		// =================================================
//		fillExcelLogo(book, waterMarkCompanyLogo, sheet1, finalCell, sheet1.getRow(0), topLeftLogoCell);
//		// =================================================
//
//		sheet1.getRow(1).getCell(0).setCellStyle(reportNameStyle);
//		sheet1.getRow(2).getCell(0).setCellStyle(reportNameStyle);
//		sheet1.getRow(3).getCell(0).setCellStyle(reportNameStyle);
//
//		List<WorkerReportDTO> workerList = reportDTO.getWorkerReportList();
//
//		//组装考勤数据
//		buildAttendanceData(workerList,projectAttendanceExportColumnConfigDTOMap,incomeMap,cell,row,sheet1,book,dateList,countHide,highCountHide,attendanceGroupCountsMap,additionalCols,addMultyAttendanceGroupCols);
//	}
//	private int buildAttendanceWideHide(Map<String, AttendanceExportContentDTO> projectAttendanceExportColumnConfigDTOMap, int countHide) {
//		//计算需要展示得横向列
//		if (projectAttendanceExportColumnConfigDTOMap.get("006").getIsHide().equals("00")) {
//			countHide = 3;
//			if (projectAttendanceExportColumnConfigDTOMap.get("007").getIsHide().equals("00")) {
//				countHide = 4;
//			}
//		}
//		if (projectAttendanceExportColumnConfigDTOMap.get("007").getIsHide().equals("00")) {
//			countHide = 3;
//			if (projectAttendanceExportColumnConfigDTOMap.get("006").getIsHide().equals("00")) {
//				countHide = 4;
//			}
//		}
//		return countHide;
//	}
//
//	private int buildAttendanceHighHide(Map<String, AttendanceExportContentDTO> projectAttendanceExportColumnConfigDTOMap, int highCountHide) {
//		//计算需要展示得纵向列
//		if (projectAttendanceExportColumnConfigDTOMap.get("001").getIsHide().equals("01")) {
//			highCountHide--;
//		}
//		if (projectAttendanceExportColumnConfigDTOMap.get("003").getIsHide().equals("01")) {
//			highCountHide--;
//		}
//		if (projectAttendanceExportColumnConfigDTOMap.get("002").getIsHide().equals("01")) {
//			highCountHide = highCountHide - 3;
//		}
//		if (projectAttendanceExportColumnConfigDTOMap.get("004").getIsHide().equals("01") && projectAttendanceExportColumnConfigDTOMap.get("002").getIsHide().equals("00")) {
//			highCountHide = highCountHide - 2;
//		}
//		return highCountHide;
//	}
//
//
//	//组装考勤工人数据
//	private void buildAttendanceData(List<WorkerReportDTO> workerList, Map<String, AttendanceExportContentDTO> projectAttendanceExportColumnConfigDTOMap, Map<String, Double> incomeMap,
//									 Cell cell, Row row, Sheet sheet1,XSSFWorkbook book, List<Date> dateList,int countHide,int hideCountHide,Map<Date, Integer> attendanceGroupCountsMap,
//									 int additionalCols,int addMultyAttendanceGroupCols) {
//		int number = 1;
//		int count = 1;
//		int currentRowCount = 6;
//
//		String recordHide = projectAttendanceExportColumnConfigDTOMap.get("001").getIsHide();
//		String overtimeHide = projectAttendanceExportColumnConfigDTOMap.get("002").getIsHide();
//		String salaryStandardHide = projectAttendanceExportColumnConfigDTOMap.get("003").getIsHide();
//		String attendanceHide = projectAttendanceExportColumnConfigDTOMap.get("004").getIsHide();
//		String phoneHide = projectAttendanceExportColumnConfigDTOMap.get("005").getIsHide();
//		String workerCategoryNameHide = projectAttendanceExportColumnConfigDTOMap.get("006").getIsHide();
//		String workerCodeHide = projectAttendanceExportColumnConfigDTOMap.get("007").getIsHide();
//
//
//		XSSFCellStyle cellStyle = book.createCellStyle();
//		cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		cellStyle.setWrapText(true);
//		cellStyle.setBorderBottom(BorderStyle.THIN);
//		cellStyle.setBorderLeft(BorderStyle.THIN);
//		cellStyle.setBorderRight(BorderStyle.THIN);
//		cellStyle.setBorderTop(BorderStyle.THIN);
//		XSSFFont cellFont = book.createFont();
//		cellFont.setFontHeightInPoints((short) 6);// 字号
//		cellStyle.setFont(cellFont);
//
//
//		if (workerList != null && !workerList.isEmpty()) {
//			double totalWorkingTimes = 0d;
//			double totalWorkingDays = 0d;
//			for (WorkerReportDTO worker : workerList) {
//				if (incomeMap.get(worker.getId()) == null) {
//					incomeMap.put(worker.getId(), 0.0);
//				}
//
//
//				//隐藏打卡记录
//				if (recordHide.equals("01")) {
//					row = sheet1.createRow(5 + count++);
//					row.setHeight((short) 400);
//					cell = row.createCell(0);
//					cell.setCellValue(number++);
//					cell.setCellStyle(cellStyle);
//
//					//是否展示手机号
//					if (phoneHide.equals("00")) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getName() + worker.getMobileNumber());
//						cell.setCellStyle(cellStyle);
//					} else {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getName());
//						cell.setCellStyle(cellStyle);
//					}
//
//					//是否展示工号
//					if (workerCodeHide.equals("00")) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getWorkerCode());
//						cell.setCellStyle(cellStyle);
//					}
//					//是否展示工种
//					if (workerCategoryNameHide.equals("00")) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getWorkerCategoryName());
//						cell.setCellStyle(cellStyle);
//					}
//				} else {
//					row = sheet1.createRow(5 + count++);
//					row.setHeight((short) 1450);
//					cell = row.createCell(0);
//					cell.setCellValue(number++);
//					cell.setCellStyle(cellStyle);
//
//					//是否展示手机号
//					if (phoneHide.equals("00")) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getName() + worker.getMobileNumber());
//						cell.setCellStyle(cellStyle);
//					} else {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getName());
//						cell.setCellStyle(cellStyle);
//					}
//
//					//是否展示工号
//					if (workerCodeHide.equals("00")) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getWorkerCode());
//						cell.setCellStyle(cellStyle);
//					}
//
//					//是否展示工种
//					if (workerCategoryNameHide.equals("00")) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(worker.getWorkerCategoryName());
//						cell.setCellStyle(cellStyle);
//					}
//					cell = row.createCell(cell.getColumnIndex() + 1);
//					cell.setCellValue("打卡记录");
//					cell.setCellStyle(cellStyle);
//					for (int i = 0; i < dateList.size(); i++) {
//						String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//						List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//						for (WorkerDataRecordDTO data : workerDataList) {
//							cell = row.createCell(cell.getColumnIndex() + 1);
//							cell.setCellStyle(cellStyle);
//							XSSFRichTextString richString2 = getXSSFRichTextString(data.getTotalRecordList(), book);
//							cell.setCellValue(richString2);
//							//cell.setCellValue(getAttendanceRecordFormatString(data.getTotalRecordList()));
//						}
//						// 额外创建单元格
//						cell = createAdditionalCells(row, cell, workerDataList.size(), attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//					}
//					//创建右边三列
//					createCells(row, cell, 4, cellStyle);
//
//				}
//				//不隐藏区分加班工时，普通出勤工时和加班工时相加，不展示“出勤标准”、“加班标准”
//				if (overtimeHide.equals("00")) {
//					if (recordHide.equals("00")) {
//						row = sheet1.createRow(5 + count++);
//						row.setHeight((short) 400);
//						cell = row.createCell(0);
//						cell = createCells(row, cell, countHide, cellStyle);
//						cell.setCellValue("普通出勤(小时)");
//						cell.setCellStyle(cellStyle);
//					} else {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellStyle(cellStyle);
////                    cell = createCells(row, cell, countHide, cellStyle);
//						cell.setCellValue("普通出勤(小时)");
//						cell.setCellStyle(cellStyle);
//
//					}
//					for (int i = 0; i < dateList.size(); i++) {
//						String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//						List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//						for (WorkerDataRecordDTO data : workerDataList) {
//							cell = row.createCell(cell.getColumnIndex() + 1);
//							cell.setCellStyle(cellStyle);
//							cell.setCellValue(formatMinutes2Hours(data.getWorkingTimes()));
//						}
//						// 额外创建单元格
//						cell = createAdditionalCells(row, cell, workerDataList.size(),
//								attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//					}
//					createCells(row, cell, 4, cellStyle);
//
//					//出勤标准
//					if (attendanceHide.equals("00")) {
//						row = sheet1.createRow(5 + count++);
//						row.setHeight((short) 400);
//						cell = row.createCell(0);
//						cell.setCellStyle(cellStyle);
//						cell = createCells(row, cell, countHide, cellStyle);
//						cell.setCellValue("出勤标准");
//						cell.setCellStyle(cellStyle);
//						for (int i = 0; i < dateList.size(); i++) {
//							String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//							List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//							for (WorkerDataRecordDTO data : workerDataList) {
//								cell = row.createCell(cell.getColumnIndex() + 1);
//								cell.setCellStyle(cellStyle);
//								cell.setCellValue(formatMinutes2Hours(data.getNormalWorkingTimes()) + "h/d");
//							}
//							// 额外创建单元格
//							cell = createAdditionalCells(row, cell, workerDataList.size(),
//									attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//						}
//						createCells(row, cell, 4, cellStyle);
//
//						row = sheet1.createRow(5 + count++);
//						row.setHeight((short) 400);
//						cell = row.createCell(0);
//						cell.setCellStyle(cellStyle);
//						cell = createCells(row, cell, countHide, cellStyle);
//						cell.setCellValue("加班工时(小时)");
//						cell.setCellStyle(cellStyle);
//						for (int i = 0; i < dateList.size(); i++) {
//							String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//							List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//							for (WorkerDataRecordDTO data : workerDataList) {
//								cell = row.createCell(cell.getColumnIndex() + 1);
//								cell.setCellStyle(cellStyle);
//								cell.setCellValue(formatMinutes2Hours(data.getOtWorkingTimes()));
//							}
//							// 额外创建单元格
//							cell = createAdditionalCells(row, cell, workerDataList.size(),
//									attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//
//						}
//						createCells(row, cell, 4, cellStyle);
//
//						row = sheet1.createRow(5 + count++);
//						row.setHeight((short) 400);
//						cell = row.createCell(0);
//						cell.setCellStyle(cellStyle);
//						cell = createCells(row, cell, countHide, cellStyle);
//						cell.setCellValue("加班标准");
//						cell.setCellStyle(cellStyle);
//						for (int i = 0; i < dateList.size(); i++) {
//							String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//							List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//							for (WorkerDataRecordDTO data : workerDataList) {
//								cell = row.createCell(cell.getColumnIndex() + 1);
//								String rule = this.getOTSalaryRule(data);
//								if (rule != null) {
//									cell.setCellValue(rule);
//								}
//								cell.setCellStyle(cellStyle);
//							}
//							// 额外创建单元格
//							cell = createAdditionalCells(row, cell, workerDataList.size(),
//									attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//						}
//						createCells(row, cell, 4, cellStyle);
//					} else {
//						row = sheet1.createRow(5 + count++);
//						row.setHeight((short) 400);
//						cell = row.createCell(0);
//						cell.setCellStyle(cellStyle);
//						cell = createCells(row, cell, countHide, cellStyle);
//						cell.setCellValue("加班工时(小时)");
//						cell.setCellStyle(cellStyle);
//						for (int i = 0; i < dateList.size(); i++) {
//							String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//							List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//							for (WorkerDataRecordDTO data : workerDataList) {
//								cell = row.createCell(cell.getColumnIndex() + 1);
//								cell.setCellStyle(cellStyle);
//								cell.setCellValue(formatMinutes2Hours(data.getOtWorkingTimes()));
//							}
//							// 额外创建单元格
//							cell = createAdditionalCells(row, cell, workerDataList.size(),
//									attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//
//						}
//						createCells(row, cell, 4, cellStyle);
//					}
//				} else {
//					if (recordHide.equals("00")) {
//						row = sheet1.createRow(5 + count++);
//						row.setHeight((short) 400);
//						cell = row.createCell(0);
//						cell.setCellStyle(cellStyle);
//						cell = createCells(row, cell, countHide, cellStyle);
//						cell.setCellValue("工时(小时)");
//						cell.setCellStyle(cellStyle);
//
//					} else {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue("工时(小时)");
//						cell.setCellStyle(cellStyle);
//					}
////                    cell.setCellStyle(cellStyle);
////                    cell = createCells(row, cell, countHide, cellStyle);
//
//					for (int i = 0; i < dateList.size(); i++) {
//						String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//						List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//						for (WorkerDataRecordDTO data : workerDataList) {
//							cell = row.createCell(cell.getColumnIndex() + 1);
//							cell.setCellStyle(cellStyle);
//							cell.setCellValue(formatMinutes2Hours(data.getWorkingTimes()) + formatMinutes2Hours(data.getOtWorkingTimes()));
//						}
//						// 额外创建单元格
//						cell = createAdditionalCells(row, cell, workerDataList.size(),
//								attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//					}
//					createCells(row, cell, 4, cellStyle);
//				}
//
//				//工资标准，不展示工资那一列
//				if (salaryStandardHide.equals("00")) {
//					/**    3.9.0薪资调整	**/
//					row = sheet1.createRow(5 + count++);
//					row.setHeight((short) 400);
//					cell = row.createCell(0);
//					cell.setCellStyle(cellStyle);
//					cell = createCells(row, cell, countHide, cellStyle);
//					cell.setCellValue("工资");
//					cell.setCellStyle(cellStyle);
//					for (int i = 0; i < dateList.size(); i++) {
//						String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//						List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//						for (WorkerDataRecordDTO data : workerDataList) {
//							cell = row.createCell(cell.getColumnIndex() + 1);
//							if (data.getWorkerDaySalaryRuleSetting() != null) {
//								if (EmodorSalaryType.DAY_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())) {
//									cell.setCellValue(data.getWorkerDaySalaryRuleSetting().getSalaryValue() + "元/天");
//								} else if (EmodorSalaryType.MONTH_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())) {
//									cell.setCellValue(data.getWorkerDaySalaryRuleSetting().getMonthSalary() + "元/月");
//								} else if (EmodorSalaryType.COUNT_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())) {
//									cell.setCellValue("计量");
//								}
//							}
//							cell.setCellStyle(cellStyle);
//						}
//						// 额外创建单元格
//						cell = createAdditionalCells(row, cell, workerDataList.size(),
//								attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//					}
//					createCells(row, cell, 4, cellStyle);
//				}
//
//
//				logger.info("当前工人：" + worker.getName() + " 当前列：" + cell.getColumnIndex());
//
//				/***
//				 * 合并单元格
//				 */
//				if (hideCountHide != 0) {
//					// 合并序号
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + hideCountHide, 0, 0));
//					// 合并姓名
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + hideCountHide, 1, 1));
//
//					//工号，工种列都不隐藏
//					if (countHide == 4) {
//						sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + hideCountHide, 2, 2));
//						sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + hideCountHide, 3, 3));
//					}
//					//工号，工种列隐藏一列
//					if (countHide == 3) {
//						sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + hideCountHide, 2, 2));
//					}
//					// 合并工人签名
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + hideCountHide,
//							1 + countHide + dateList.size() + 2 + additionalCols,
//							1 + countHide + dateList.size() + 2 + additionalCols));
//					// 合并备注
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + hideCountHide,
//							1 + countHide + dateList.size() + 3 + additionalCols,
//							1 + countHide + dateList.size() + 3 + additionalCols));
//
//				}
//				//单独处理合并的各种情况
//				if (recordHide.equals("01") && overtimeHide.equals("00") && attendanceHide.equals("00")) {
//					// 合并合计工时
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 1,
//							1 + countHide + dateList.size() + additionalCols,
//							1 + countHide + dateList.size() + additionalCols));
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 2, currentRowCount + 3,
//							1 + countHide + dateList.size() + additionalCols,
//							1 + countHide + dateList.size() + additionalCols));
//
//					// 合并合计工天
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 1,
//							1 + countHide + dateList.size() + 1 + additionalCols,
//							1 + countHide + dateList.size() + 1 + additionalCols));
//
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 2, currentRowCount + 3,
//							1 + countHide + dateList.size() + 1 + additionalCols,
//							1 + countHide + dateList.size() + 1 + additionalCols));
//					// 正常开工工时汇总
//					row = sheet1.getRow(currentRowCount);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工时汇总
//					row = sheet1.getRow(currentRowCount + 2);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getOtWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getOtWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 正常开工工天汇总
//					row = sheet1.getRow(currentRowCount);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getWorkingDays()));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工天汇总
//					row = sheet1.getRow(currentRowCount + 2);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()));
//					cell.setCellStyle(cellStyle);
//				}
//
//				if (recordHide.equals("01") && overtimeHide.equals("00") && attendanceHide.equals("01")) {
//					// 正常开工工时汇总
//					row = sheet1.getRow(currentRowCount);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工时汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getOtWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getOtWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 正常开工工天汇总
//					row = sheet1.getRow(currentRowCount);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getWorkingDays()));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工天汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()));
//					cell.setCellStyle(cellStyle);
//				}
//
//				//不用合并
//				//普通工时+加班工时
//				int salaryOfTime = worker.getWorkingTimes() + worker.getOtWorkingTimes();
//				double salaryOfDay = worker.getWorkingDays() + worker.getOtWorkingDays();
//				if (recordHide.equals("01") && overtimeHide.equals("01") && attendanceHide.equals("00")) {
//					// 正常开工工时汇总
//					row = sheet1.getRow(currentRowCount);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(salaryOfTime) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(salaryOfTime)));
//					cell.setCellStyle(cellStyle);
//
//
//					// 正常开工工天汇总
//					row = sheet1.getRow(currentRowCount);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, salaryOfDay) == 0 ? 0 : MathUtil.formatDecimalValue(3, salaryOfDay));
//					cell.setCellStyle(cellStyle);
//				}
//				//不用合并
//				if (recordHide.equals("00") && overtimeHide.equals("00") && attendanceHide.equals("00")) {
//
//					// 合并合计工时
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 1, currentRowCount + 2,
//							1 + countHide + dateList.size() + additionalCols,
//							1 + countHide + dateList.size() + additionalCols));
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 3, currentRowCount + 4,
//							1 + countHide + dateList.size() + additionalCols,
//							1 + countHide + dateList.size() + additionalCols));
//
//					// 合并合计工天
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 1, currentRowCount + 2,
//							1 + countHide + dateList.size() + 1 + additionalCols,
//							1 + countHide + dateList.size() + 1 + additionalCols));
//					sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 3, currentRowCount + 4,
//							1 + countHide + dateList.size() + 1 + additionalCols,
//							1 + countHide + dateList.size() + 1 + additionalCols));
//
//
//					// 正常开工工时汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工时汇总
//					row = sheet1.getRow(currentRowCount + 3);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getOtWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getOtWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 正常开工工天汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getWorkingDays()));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工天汇总
//					row = sheet1.getRow(currentRowCount + 3);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()));
//					cell.setCellStyle(cellStyle);
//				}
//
//				//不用合并
//				if (recordHide.equals("00") && overtimeHide.equals("00") && attendanceHide.equals("01")) {
//					// 正常开工工时汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工时汇总
//					row = sheet1.getRow(currentRowCount + 2);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(worker.getOtWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getOtWorkingTimes())));
//					cell.setCellStyle(cellStyle);
//
//					// 正常开工工天汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getWorkingDays()));
//					cell.setCellStyle(cellStyle);
//
//					// 加班工天汇总
//					row = sheet1.getRow(currentRowCount + 2);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()));
//					cell.setCellStyle(cellStyle);
//				}
//
//
//				//不用合并
//				if ((recordHide.equals("00") && overtimeHide.equals("01") && attendanceHide.equals("00")) || (recordHide.equals("00") && overtimeHide.equals("01") && attendanceHide.equals("01"))) {
//
//					// 正常开工工时汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + additionalCols);
//					cell.setCellValue(formatMinutes2Hours(salaryOfTime) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(salaryOfTime)));
//					cell.setCellStyle(cellStyle);
//
//
//					// 正常开工工天汇总
//					row = sheet1.getRow(currentRowCount + 1);
//					cell = row.getCell(1 + countHide + dateList.size() + 1 + additionalCols);
//					cell.setCellValue(MathUtil.formatDecimalValue(3, salaryOfDay) == 0 ? 0 : MathUtil.formatDecimalValue(3, salaryOfDay));
//					cell.setCellStyle(cellStyle);
//				}
//
//				currentRowCount = currentRowCount + hideCountHide + 1;
//				// 累计工时
//				// 累计工天
//				totalWorkingTimes += formatMinutes2Hours(worker.getWorkingTimes()) + formatMinutes2Hours(worker.getOtWorkingTimes());
//				totalWorkingDays += worker.getWorkingDays() + worker.getOtWorkingDays();
//			}
//			row = sheet1.createRow(5 + count++);
//			row.setHeight((short) 400);
//			cell = row.createCell(0);
//			cell.setCellStyle(cellStyle);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 700);
//			createCells(row, cell, countHide + dateList.size() + 4 + addMultyAttendanceGroupCols, cellStyle);
//
//			cell = row.getCell(1 + countHide + addMultyAttendanceGroupCols + dateList.size() - 1);
//			cell.setCellValue("总计");
//			cell.setCellStyle(cellStyle);
//
//			cell = row.getCell(1 + countHide + addMultyAttendanceGroupCols + dateList.size());
//			cell.setCellValue(totalWorkingTimes == 0 ? 0 : MathUtil.formatDecimalValue(1, totalWorkingTimes));
//			cell.setCellStyle(cellStyle);
//
//			cell = row.getCell(1 + countHide + addMultyAttendanceGroupCols + dateList.size() + 1);
//			cell.setCellValue(totalWorkingDays == 0 ? 0 : MathUtil.formatDecimalValue(1, totalWorkingDays));
//			cell.setCellStyle(cellStyle);
//		}
//	}
//
//
//
//
//
//	public File generateWorkerGroupLastExcel(String waterMarkCompanyLogo,String groupId, String startDate, String endDate,
//											 String output, String fileName,List<String> projectIds) throws Exception {
//		long start = System.currentTimeMillis();
//
//		XSSFWorkbook book = new XSSFWorkbook();
//
//		Map<String, Double> incomeMap = new HashMap<>();
//
//		createAttendanceSheetByProject(book, "考勤记录表", waterMarkCompanyLogo, groupId, startDate, endDate, incomeMap, projectIds);
//
//		File newFile = new File(output + fileName);
//		try {
//			InputStream is = null;
//			FileOutputStream fos = new FileOutputStream(newFile);
//			book.write(fos);
//			fos.flush();
//			fos.close();
//		} catch(Exception e) {
//			logger.error("生成班组考勤统计表失败",e);
//		}
//
//		long end = System.currentTimeMillis();
//
//		logger.info("完成生成班组考勤统计表时间:{}秒", (end - start)/1000);
//
//		return newFile;
//	}
//
//
//
//
////	/**
////	 * 生成班组报表
////	 *
////	 * @param groupId
////	 * @param startDate
////	 * @param endDate
////	 * @param output
////	 * @param fileName
////	 * @return
////	 * @throws FileNotFoundException
////	 * @throws IOException
////	 */
////	public String generateWorkerGroupExcel(String groupId, String startDate, String endDate, String output,
////			String fileName) throws Exception {
////
////		XSSFWorkbook book = new XSSFWorkbook();
////
////		Map<String, Double> incomeMap = new HashMap<>();
////		createAttendanceSheetByGroupId(book, "考勤记录表", groupId, startDate, endDate, incomeMap);
////
////		String completeName = output + "/" + fileName;
////		book.write(new FileOutputStream(completeName));
////
////		return null;
////
////	}
//
//
//	/**
//	 //	/**
//	 //	 * 生成班组工资分配报表
//	 //	 *
//	 //	 * @param groupId
//	 //	 * @param startDate
//	 //	 * @param endDate
//	 //	 * @param output
//	 //	 * @param fileName
//	 //	 * @return
//	 //	 * @throws FileNotFoundException
//	 //	 * @throws IOException
//	 //	 */
////	public String generateWorkerGroupSalaryReport(String groupId, String startDate, String endDate, String output,
////			String fileName) throws Exception {
////
////		XSSFWorkbook book = new XSSFWorkbook();
////
////		Map<String, Double> incomeMap = new HashMap<>();
////		Map<String, WorkerReportDTO> workerReportMap = new HashMap<>();
////		createAttendanceSalarySheetByGroupId(book, "考勤记录表", groupId, startDate, endDate, incomeMap,workerReportMap);
////
////		// 生成工资表
////		createBankSheetByWorkerGroupId(book, startDate, endDate, groupId, incomeMap, workerReportMap);
////
////		book.setSheetOrder("工资分配表", 0);
////		book.setSheetOrder("考勤记录表", 1);
////
////		String completeName = output + "/" + fileName;
////		book.write(new FileOutputStream(completeName));
////
////		return null;
////
////	}
//
//	public void generateProjectAttendanceExcel(ProjectAttendanceQueryDTO queryDTO, String companyId, String output, String fileName, SysUserDTO user) {
//		long start = System.currentTimeMillis();
//		XSSFWorkbook book = new XSSFWorkbook();
//
//		Map<String,Double> incomeMap = new ConcurrentHashMap<>();
//
//		createProjectAttendanceSheet(book,"项目概况", queryDTO, companyId, incomeMap, user);
////		book.setSheetOrder("项目概况表", 0);
//
//		File newFile = new File(output + fileName);
//		try {
//			InputStream is = null;
//			FileOutputStream fos = new FileOutputStream(newFile);
//			book.write(fos);
//			fos.flush();
//			fos.close();
//		}catch(Exception e) {
//			logger.error("生成项目概况表失败",e);
//		}
//
//		long end = System.currentTimeMillis();
//
//		logger.info("完成生成项目概况表时间:------------------------" + (end - start)/1000 + "秒");
//
//	}
//
//	/**
//	 * 生成项目出勤数据统计Excel
//	 * @param output
//	 * @param fileName
//	 */
//	public void generateProjectStatisticExcel(ProjectStasticQueryCriteriaDTO queryDTO, String companyId, String output, String fileName, SysUserDTO user) {
//		long start = System.currentTimeMillis();
//
//		XSSFWorkbook book = new XSSFWorkbook();
//		ExportProjectStatistic exportProjectStatisHelper = new ExportProjectStatistic();
//
//		queryDTO.setPage(null);
//		queryDTO.setSize(null);
//		//  2021/1/27 考虑权限
//		if (StringUtils.isBlank(queryDTO.getCompanyId())) {
//			queryDTO.setCompanyId(companyId);
//		}
//		List<ProjectStatisticsDTO> projectStatisticList = projectStatisticService.listProjectQueryStatisticsAccordingPermissions(queryDTO, user);
//		book = exportProjectStatisHelper.createProjectStatisticSheet(book, queryDTO, projectStatisticList, companyId, user);
//
//		File newFile = new File(output + fileName);
//		try {
//			FileOutputStream fos = new FileOutputStream(newFile);
//			book.write(fos);
//			fos.flush();
//			fos.close();
//		}catch(Exception e) {
//			logger.error("生成项目概况表失败",e);
//		}
//
//		long end = System.currentTimeMillis();
//
//		logger.info("完成生成项目概况表时间:------------------------" + (end - start)/1000 + "秒");
//
//	}
//
//	/**
//	 * 如果在某一天工人在多个考勤组有打卡记录则后续的工人在该天也得额外创建相同数量的单元格保证格式统一
//	 *
//	 * @param currentRow
//	 * @param currentCell
//	 * @param attendanceGroupSize
//	 * @param maxAttendanceGroupCounts
//	 */
//	private Cell createAdditionalCells(Row currentRow, Cell currentCell, int attendanceGroupSize,
//			int maxAttendanceGroupCounts) {
//		if (attendanceGroupSize < maxAttendanceGroupCounts) {
//			int value = maxAttendanceGroupCounts - attendanceGroupSize;
//			while (value > 0) {
//				currentCell = currentRow.createCell(currentCell.getColumnIndex() + 1);
//				value--;
//			}
//		}
//		return currentCell;
//	}
//
//	/**
//	 * 如果在某一天工人在多个考勤组有打卡记录则后续的工人在该天也得额外创建相同数量的单元格保证格式统一
//	 *
//	 * @param currentRow
//	 * @param currentCell
//	 * @param attendanceGroupSize
//	 * @param maxAttendanceGroupCounts
//	 */
//	private Cell createAdditionalCells(Row currentRow, Cell currentCell, int attendanceGroupSize,
//			int maxAttendanceGroupCounts,XSSFCellStyle cellStyle) {
//		if (attendanceGroupSize < maxAttendanceGroupCounts) {
//			int value = maxAttendanceGroupCounts - attendanceGroupSize;
//			while (value > 0) {
//				currentCell = currentRow.createCell(currentCell.getColumnIndex() + 1);
//				currentCell.setCellStyle(cellStyle);
//				value--;
//			}
//		}
//		return currentCell;
//	}
//	/**
//	 * 在当前行当前单元格创建多少个单元格
//	 *
//	 * @param currentRow
//	 * @param currentCell
//	 * @param nums
//	 */
//	private Cell createCells(Row currentRow, Cell currentCell, int nums, XSSFCellStyle cellStyle) {
//		if (nums > 0) {
//			while (nums > 0) {
//				currentCell = currentRow.createCell(currentCell.getColumnIndex() + 1);
//				currentCell.setCellStyle(cellStyle);
//				nums--;
//			}
//		}
//		return currentCell;
//	}
//
//	private XSSFRichTextString getXSSFRichTextString(List<WorkerAttendanceRecordDTO> recordList, XSSFWorkbook book){
//		//创建字体
//		XSSFFont ftRed  = book.createFont();
//		ftRed.setFontHeightInPoints((short) 6);// 字号
//		ftRed.setUnderline((byte)1);
//		ftRed.setColor(HSSFColor.RED.index);
//		//创建字体
//		XSSFFont ftBlack  = book.createFont();
//		ftBlack.setFontHeightInPoints((short) 6);// 字号
//		StringBuilder attendanceTimes = new StringBuilder();
//		List<AttendanceIndexDTO> indexList = new ArrayList<>();
//		if (recordList != null && !recordList.isEmpty()) {
//			for (WorkerAttendanceRecordDTO record : recordList) {
//
//				if (record.getStatus().equals(EmodorAttendanceStatus.LACK.getStatus())) {
//					AttendanceIndexDTO attendanceIndexDTO = new AttendanceIndexDTO();
//					attendanceIndexDTO.setStart(attendanceTimes.toString().length());
//					attendanceIndexDTO.setEnd(attendanceTimes.toString().length()+1);
//					attendanceIndexDTO.setRed(false);
//					indexList.add(attendanceIndexDTO);
//					attendanceTimes.append("-");
//				}
//
//				else {
//					//标记标红的字符串索引
//					AttendanceIndexDTO attendanceIndexDTO = new AttendanceIndexDTO();
//					attendanceIndexDTO.setStart(attendanceTimes.toString().length());
//					attendanceIndexDTO.setEnd(attendanceTimes.toString().length()+5);
//					if (StringUtils.isNotBlank(record.getReason())) {
//						attendanceIndexDTO.setRed(true);
//					}else {
//						attendanceIndexDTO.setRed(false);
//					}
//					indexList.add(attendanceIndexDTO);
//					String recordDate = DateUtil.getInstance().getDateTime(record.getRecordDetailTime(), null);
//					attendanceTimes.append(recordDate.substring(11, 16));
//
//				}
//				attendanceTimes.append("\r\n");
//			}
//		}
//		String descripion = attendanceTimes.toString();
//		XSSFRichTextString richString = new XSSFRichTextString(descripion);
//		for (AttendanceIndexDTO dto :  indexList) {
//			if (dto.getRed()){
//				richString.applyFont(dto.getStart(), dto.getEnd(), ftRed);
//			}else {
//				richString.applyFont(dto.getStart(), dto.getEnd(), ftBlack);
//			}
//
//		}
//		return richString;
//	}
//
//
//	private String getAttendanceRecordFormatString(List<WorkerAttendanceRecordDTO> recordList) {
//		StringBuilder attendanceTimes = new StringBuilder();
//		if (recordList != null && !recordList.isEmpty()) {
//			for (WorkerAttendanceRecordDTO record : recordList) {
//
//				if (record.getStatus().equals(EmodorAttendanceStatus.LACK.getStatus())) {
//					attendanceTimes.append("-");
//				}
//
//				else {
//
//					String recordDate = DateUtil.getInstance().getDateTime(record.getRecordDetailTime(), null);
//					attendanceTimes.append(recordDate.substring(11, 16));
//				}
//				attendanceTimes.append("\r\n");
//			}
//		}
//
//		return attendanceTimes.toString().trim();
//
//	}
//	private XSSFCellStyle getXssfCellStyle(XSSFWorkbook book,short boldweight,short alignment) {
//		XSSFCellStyle reportNameStyle = book.createCellStyle();
//		XSSFFont reportFontFont = book.createFont();
//		reportFontFont.setFontName("黑体");
//		reportFontFont.setFontHeightInPoints((short) 8);// 字号
//		reportFontFont.setBoldweight(boldweight);// 加粗
//		reportNameStyle.setFont(reportFontFont);
//		reportNameStyle.setAlignment(alignment);// 左右居中
//		reportNameStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		reportNameStyle.setWrapText(true);
//		reportNameStyle.setBorderBottom(BorderStyle.THIN);
//		reportNameStyle.setBorderLeft(BorderStyle.THIN);
//		reportNameStyle.setBorderRight(BorderStyle.THIN);
//		reportNameStyle.setBorderTop(BorderStyle.THIN);
//		return reportNameStyle;
//	}
//
//
//
//	/**
//	 * @describe:
//	 * 计算图片的高度与宽度，跟固定高度比较转化，等比缩放或放大宽度。
//	 * 根据宽度，计算要跨越多少个单元格。得到对应的cell1单元格。
//	 * 获得cell1单元格中的坐标位置。
//	 * PS:单元格的宽度和高度单位不一致。前者是字符，后者是点。
//	 *
//	 *
//	 * ps:如果不指定列的宽度，默认是8个字符，也就是8 * 256
//	 * @version:3.9.1
//	 * @author: jkun(练习时长两年半)
//	 * @return:
//	 */
//	private void fillExcelLogo(XSSFWorkbook book, String waterMarkCompanyLogo, Sheet sheet1, Cell finalCell,Row row,int leftTopCellNum) {
//		if (StringUtils.isBlank(waterMarkCompanyLogo)) {
//			return;
//		}
//
//		Cell cell1 = null;
//		Cell cell2 = finalCell;
//		HttpURLConnection conn = null;
//		InputStream inputStream = null;
//		BufferedImage image = null;
//		try {
//
//			URL url = new URL(waterMarkCompanyLogo);
//			conn = (HttpURLConnection) url.openConnection();
//			conn.setRequestMethod("GET");
//			conn.setConnectTimeout(20 * 1000);
//			ByteArrayOutputStream output = new ByteArrayOutputStream();
//
//			inputStream = conn.getInputStream();
//			IOUtils.copy(inputStream, output);
//			//  必须准备两份资源！！！
//			ByteArrayInputStream inputStreamPic = new ByteArrayInputStream(output.toByteArray());
//			ByteArrayInputStream imageStream = new ByteArrayInputStream(output.toByteArray());
//			image = ImageIO.read(imageStream);
//
//			int pictureIdx = book.addPicture(inputStreamPic, Workbook.PICTURE_TYPE_JPEG);
//			float initWith = 0;
//			float initHigh = 0;
//			float v = row.getHeightInPoints() / 72f;
//			//  1 inch = 72 point = 96 px
//			initHigh = v * 96f;
//
//			float highScaler = initHigh/(float) image.getHeight();
//			initWith = (float)image.getWidth() * highScaler;
//
//			int i1 = cell2.getColumnIndex() + 1 - leftTopCellNum;
//			int allColumWithInPx = 0;
//
//			for (int i = 0; i < i1; i++) {
//				allColumWithInPx = allColumWithInPx + Math.round(sheet1.getColumnWidthInPixels(row.getCell(leftTopCellNum+i).getColumnIndex()));
//			}
//			int columWidthInPx = allColumWithInPx / i1;
//
////			int columWidthInPx = Math.round(sheet1.getColumnWidthInPixels(cell2.getColumnIndex()));
//
////            int picCoverAllWidthPx = Math.round(sheet1.getColumnWidthInPixels((int)initWith));
//			int i = Math.round(initWith)/ columWidthInPx;
//			if (i > 0 && i < (finalCell.getColumnIndex() - leftTopCellNum)) {
//				cell1 = row.getCell(cell2.getColumnIndex() - i);
//			} else if (i >= (finalCell.getColumnIndex() - leftTopCellNum)) {
//				cell1 = row.getCell(leftTopCellNum);
//			} else {
//				cell1 = cell2;
//			}
//
//			CreationHelper helper = sheet1.getWorkbook().getCreationHelper();
//			ClientAnchor anchor = helper.createClientAnchor();
//
//			//  图像右上角所在单元格的图像右上角坐标
//			anchor.setDx2(Units.pixelToEMU(columWidthInPx));
//			anchor.setDy2(Units.toEMU(row.getHeightInPoints())); //
//
//			//  图像左下角所在单元格的图像左下角坐标
//			anchor.setDx1(0); // TODO: 2022/3/18 理应事实计算
//			anchor.setDy1(0);
//
//			//  图像左下角所处单元格与图像右上角所处单元格
//			anchor.setCol1(cell1.getColumnIndex());
//			anchor.setRow1(cell1.getRowIndex());
//			anchor.setCol2(cell2.getColumnIndex());
//			anchor.setRow2(cell2.getRowIndex());
//
//			//  边框自适应（拉动单元格时，图片追随）
//			anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
//			//  最终插入图片
//			Drawing drawing = sheet1.createDrawingPatriarch();
//			drawing.createPicture(anchor, pictureIdx);
//		} catch (Exception e) {
//			e.printStackTrace();
//		} finally {
//			ResourceCloseUtil.closeJDBCResource2(inputStream);
//		}
//	}
//
//	/**
//	 * 根据班组Id生成考勤记录
//	 *
//	 * @param book
//	 * @param sheetName
//	 * @param groupId
//	 * @param startDate
//	 * @param endDate
//	 */
//	private void createAttendanceSheetByGroupId(String companyWaterMarkLogo,XSSFWorkbook book, String sheetName, String groupId, String startDate,
//			String endDate, Map<String, Double> incomeMap) {
//		GroupSalaryReportDTO reportDTO = groupService.getGroupSalaryReport(groupId, startDate, endDate);
//		String laborCompanyName = groupService.getGroupLaborCompanyName(groupId);
//		String contractorName = groupService.getGroupProjectContractorName(groupId);
//		String companyName = groupService.getCompanyNameByGroupId(groupId);
//		List<Date> dateList = new ArrayList<>();
//		DateUtil dateUtil = DateUtil.getInstance();
//		Date sDate = dateUtil.parseToDate2(startDate);
//		Date eDate = dateUtil.parseToDate2(endDate);
//
//		long days = dateUtil.diffDays(eDate, sDate);
//
//		for (int i = 0; i <= days; i++) {
//			Date date = dateUtil.getDateAfter(sDate, i);
//			dateList.add(date);
//		}
//
//		int addMultyAttendanceGroupCols = 0;
//		for (int i = 0; i < dateList.size(); i++) {
//
//			int maxAttendanceGroupCounts = groupService.getMaxAttendanceGroupCountsByGroupIdAndRecordDate(groupId,
//					DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT));
//			// 出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//				addMultyAttendanceGroupCols = addMultyAttendanceGroupCols + maxAttendanceGroupCounts - 1;
//			}
//		}
//		String reportName =  "云筑考勤统计表";
//		String createDate = "统计范围："+startDate + " 至 " + endDate+"      制表时间：" + DateUtil.getInstance().getDateTime() + "(北京时间)";
//
//		Sheet sheet1 = book.createSheet(sheetName);
//
//		XSSFCellStyle title = book.createCellStyle();
//		XSSFFont reportFontFontTitle = book.createFont();
//		reportFontFontTitle.setFontName("黑体");
//		reportFontFontTitle.setFontHeightInPoints((short) 18);// 字号
//		reportFontFontTitle.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		title.setFont(reportFontFontTitle);
//		title.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		title.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		title.setWrapText(true);
//		title.setBorderBottom(BorderStyle.THIN);
//		title.setBorderLeft(BorderStyle.THIN);
//		title.setBorderRight(BorderStyle.THIN);
//		title.setBorderTop(BorderStyle.THIN);
//
//		XSSFCellStyle reportNameStyle = book.createCellStyle();
//		XSSFFont reportFontFont = book.createFont();
//		reportFontFont.setFontName("黑体");
//		reportFontFont.setFontHeightInPoints((short) 8);// 字号
//		reportFontFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		reportNameStyle.setFont(reportFontFont);
//		reportNameStyle.setAlignment(XSSFCellStyle.ALIGN_LEFT);// 左右居中
//		reportNameStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		reportNameStyle.setBorderBottom(BorderStyle.THIN);
//		reportNameStyle.setBorderLeft(BorderStyle.THIN);
//		reportNameStyle.setBorderRight(BorderStyle.THIN);
//		reportNameStyle.setBorderTop(BorderStyle.THIN);
//		reportNameStyle.setWrapText(true);
//
//		XSSFCellStyle style = book.createCellStyle();
//		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
//		XSSFFont titleFont = book.createFont();
//		titleFont.setFontName("黑体");
//		titleFont.setFontHeightInPoints((short) 16);// 字号
//		titleFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		style.setFont(titleFont);
//		style.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		style.setWrapText(true);// 自动换行
//		style.setBorderBottom(BorderStyle.THIN);
//		style.setBorderLeft(BorderStyle.THIN);
//		style.setBorderRight(BorderStyle.THIN);
//		style.setBorderTop(BorderStyle.THIN);
//
//
//		short titleHeigh = 300;
//
//		sheet1.setColumnWidth(2, 2048);
//		// style.setRotation(short rotation);//单元格内容的旋转的角度
//		// 设置相应的行（初始从0开始）
//		Row row = sheet1.createRow(0);
//		row.setHeight((short) 880);
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		Cell cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue(reportName);
//
//		cell.setCellStyle(getXssfCellStyle(book,XSSFFont.BOLDWEIGHT_NORMAL,XSSFCellStyle.ALIGN_LEFT));
//		sheet1.setColumnWidth(0, 600);
//		// sheet1.setColumnWidth(5, 6000);
//		row.setHeight((short) 380);
//		Cell titleRightCell =  createCells(row,cell, 4 ,title);
//
//
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		cell = row.createCell(titleRightCell.getColumnIndex() + 1);
//
//		cell.setCellStyle(title);
//		Cell finalCell = createCells(row, cell, 3 + dateList.size() + addMultyAttendanceGroupCols, title);
//		int topLeftCellIndex = cell.getColumnIndex();
//
//
//
//		row = sheet1.createRow(1);
//		cell = row.createCell(0);
//		row.setHeight(titleHeigh);
//		cell.setCellValue(createDate);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell, 8 + dateList.size() + addMultyAttendanceGroupCols,reportNameStyle);
//
//		row = sheet1.createRow(2);
//		row.setHeight(titleHeigh);
//		cell = row.createCell(0);
//		cell.setCellValue("项目：" + reportDTO.getProjectName()+"   班组：" + reportDTO.getGroupName()+"   劳务公司：" + (StringUtils.isNotBlank(laborCompanyName) ? laborCompanyName : StringUtils.isNotBlank(contractorName) ? contractorName : companyName));
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell, 8 + dateList.size() + addMultyAttendanceGroupCols,reportNameStyle);
//
//		row = sheet1.createRow(3);
//		row.setHeight((short) 1449);
//		cell = row.createCell(0);
//
//		// 默认是按30分钟算
//		String minutes = "30分钟";
//		if (reportDTO != null) {
//			if (EmodorDataDictConstant.SALARY_TYPE_ONE_MINUTE.equals(reportDTO.getSalaryRule())) {
//				minutes = "1分钟";
//			} else if (EmodorDataDictConstant.SALARY_TYPE_HALF_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "30分钟";
//			} else if (EmodorDataDictConstant.SALART_TYPE_ONE_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "60分钟";
//			}
//		}
//
//		//创建字体
//		XSSFFont ftRed = book.createFont();
//		ftRed.setColor(HSSFColor.RED.index);
//		ftRed.setFontName("黑体");
//		ftRed.setFontHeightInPoints((short) 8);// 字号
//		ftRed.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		String descripion = "说明:\r\n (1) 出勤标准8h/d表示出勤8个小时算1个工\r\n (2) 工时扣除迟到早退时间\r\n (3) 迟到早退时间取整，最小单位为&minutes&\r\n (4) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//				" \r\n (5) ■管理员修改";
//		if (reportDTO != null && StringUtils.isNotBlank(reportDTO.getSalaryRule()) && reportDTO.getSalaryRule().equals(SalaryRuleType.SALART_TYPE_ONE_CLICK.getType())) {
//			descripion = "说明:\r\n (1) 出勤标准打卡一次算1个工\r\n (2) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//					" \r\n (3) ■管理员修改";
//		}
//
//
//		descripion = descripion.replace("&minutes&", minutes);
//		XSSFRichTextString richString = new XSSFRichTextString(descripion);
//		richString.applyFont(descripion.indexOf("■"), descripion.indexOf("■") + 1, ftRed);
//		XSSFFont ftB = book.createFont();
//		ftB.setFontName("黑体");
//		ftB.setFontHeightInPoints((short) 8);// 字号
//		ftB.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		richString.applyFont(descripion.indexOf("■") + 1, descripion.length(), ftB);
//		cell.setCellValue(richString);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell, 8 + dateList.size() + addMultyAttendanceGroupCols, reportNameStyle);
//
//
//		XSSFCellStyle cellStyle = book.createCellStyle();
//		cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		cellStyle.setWrapText(true);
//		cellStyle.setBorderBottom(BorderStyle.THIN);
//		cellStyle.setBorderLeft(BorderStyle.THIN);
//		cellStyle.setBorderRight(BorderStyle.THIN);
//		cellStyle.setBorderTop(BorderStyle.THIN);
//		XSSFFont cellFont = book.createFont();
//		cellFont.setFontHeightInPoints((short) 6);// 字号
//		cellStyle.setFont(cellFont);
//
//		// 日期左边单元格列数
//		int leftDateColNumbers = 5;
//		row = sheet1.createRow(4);
//		row.setHeight((short) 450);
//		cell = row.createCell(0);
//		cell.setCellValue("序号");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 700);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("姓名");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工号");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 850);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工种");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 850);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		int additionalCols = 0;
//
//		Map<Date, Integer> attendanceGroupCountsMap = new HashMap<>();
//		for (int i = 0; i < dateList.size(); i++) {
//			cell = row.createCell(cell.getColumnIndex() + 1);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//			String dateTime = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_SIMPLEFORMAT3);
//			cell.setCellValue(dateTime.substring(3));
//			cell.setCellStyle(cellStyle);
//
//			int maxAttendanceGroupCounts = groupService.getMaxAttendanceGroupCountsByGroupIdAndRecordDate(groupId,
//					DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT));
//
//			if (maxAttendanceGroupCounts == 0) {
//				// 至少需要创建一列
//				maxAttendanceGroupCounts = 1;
//			}
//			attendanceGroupCountsMap.put(dateList.get(i), maxAttendanceGroupCounts);
//			// 出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//
//				int dateCounts = 1;
//				while (dateCounts < maxAttendanceGroupCounts) {
//					cell = row.createCell(cell.getColumnIndex() + 1);
//					sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//					cell.setCellStyle(cellStyle);
//					dateCounts++;
//				}
//				sheet1.addMergedRegion(new CellRangeAddress(4, 4, 5 + i + additionalCols,
//						5 + i + additionalCols + maxAttendanceGroupCounts - 1));
//				additionalCols = additionalCols + maxAttendanceGroupCounts - 1;
//			}
//		}
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("合计工时(小时)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("合计工天(工)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工人签名");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("备注");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 600);
//
////		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 0, 5 + dateList.size() + additionalCols));
////		sheet1.addMergedRegion(new CellRangeAddress(1, 1, 0, 5 + dateList.size() + additionalCols));
////		sheet1.addMergedRegion(new CellRangeAddress(2, 2, 0, 5 + dateList.size() + additionalCols));
////		sheet1.addMergedRegion(new CellRangeAddress(3, 3, 0, 5 + dateList.size() + additionalCols));
//
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 0, 4));
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 5, 8 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(1, 1, 0, 8 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(2, 2, 0, 8 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(3, 3, 0, 8 + dateList.size() + additionalCols));
//		//  2022年3月18日
//		// =================================================
//		fillExcelLogo(book, companyWaterMarkLogo, sheet1, finalCell,sheet1.getRow(0),topLeftCellIndex);
//		//sheet1.getRow(0).getCell(0).setCellStyle(reportNameStyle);
//		sheet1.getRow(1).getCell(0).setCellStyle(reportNameStyle);
//		sheet1.getRow(2).getCell(0).setCellStyle(reportNameStyle);
//		sheet1.getRow(3).getCell(0).setCellStyle(reportNameStyle);
//
//		List<WorkerReportDTO> workerList = reportDTO.getWorkerReportList();
//
//		int number = 1;
//		int count = 1;
//		int currentRowCount = 5;
//		if (workerList != null && !workerList.isEmpty()) {
//			double totalWorkingTimes = 0d;
//			double totalWorkingDays = 0d;
//			for (WorkerReportDTO worker : workerList) {
//				if (incomeMap.get(worker.getId()) == null) {
//					incomeMap.put(worker.getId(), 0.0);
//				}
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 1540);
//				cell = row.createCell(0);
//				cell.setCellValue(number++);
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue(worker.getName() + worker.getMobileNumber());
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue(worker.getWorkerCode());
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue(worker.getWorkerCategoryName());
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue("打卡记录");
//				cell.setCellStyle(cellStyle);
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellStyle(cellStyle);
//						XSSFRichTextString richString2 = getXSSFRichTextString(data.getTotalRecordList(), book);
//						cell.setCellValue(richString2);
//						//cell.setCellValue(getAttendanceRecordFormatString(data.getTotalRecordList()));
//					}
//					// 额外创建单元格
//					cell = createAdditionalCells(row, cell, workerDataList.size(), attendanceGroupCountsMap.get(dateList.get(i)), cellStyle);
//				}
//				//创建右边三列
//				createCells(row, cell, 4, cellStyle);
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("普通出勤(小时)");
//				cell.setCellStyle(cellStyle);
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellStyle(cellStyle);
//						cell.setCellValue(formatMinutes2Hours(data.getWorkingTimes()));
//					}
//					// 额外创建单元格
//					cell = createAdditionalCells(row, cell, workerDataList.size(),
//							attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//				createCells(row, cell, 4, cellStyle);
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("出勤标准");
//				cell.setCellStyle(cellStyle);
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellStyle(cellStyle);
//						cell.setCellValue(formatMinutes2Hours(data.getNormalWorkingTimes()) + "h/d");
//					}
//					// 额外创建单元格
//					cell = createAdditionalCells(row, cell, workerDataList.size(),
//							attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//				createCells(row, cell, 4, cellStyle);
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("加班工时(小时)");
//				cell.setCellStyle(cellStyle);
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellStyle(cellStyle);
//						cell.setCellValue(formatMinutes2Hours(data.getOtWorkingTimes()));
//					}
//					// 额外创建单元格
//					cell = createAdditionalCells(row, cell, workerDataList.size(),
//							attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//
//				}
//				createCells(row, cell, 4, cellStyle);
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("加班标准");
//				cell.setCellStyle(cellStyle);
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						String rule = this.getOTSalaryRule(data);
//						if (rule != null) {
//							cell.setCellValue(rule);
//						}
//						cell.setCellStyle(cellStyle);
//					}
//					// 额外创建单元格
//					cell = createAdditionalCells(row, cell, workerDataList.size(),
//							attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//				createCells(row, cell, 4, cellStyle);
//
//				/** 	3.9.0薪资调整	**/
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("工资");
//				cell.setCellStyle(cellStyle);
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						if (data.getWorkerDaySalaryRuleSetting() != null) {
//							if (EmodorSalaryType.DAY_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())){
//								cell.setCellValue( data.getWorkerDaySalaryRuleSetting().getSalaryValue() + "元/天");
//							} else if (EmodorSalaryType.MONTH_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())){
//								cell.setCellValue( data.getWorkerDaySalaryRuleSetting().getMonthSalary() + "元/月");
//							} else if (EmodorSalaryType.COUNT_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())){
//								cell.setCellValue("计量");
//							}
//						}
//						cell.setCellStyle(cellStyle);
//					}
//					// 额外创建单元格
//					cell = createAdditionalCells(row, cell, workerDataList.size(),
//							attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//				createCells(row, cell, 4, cellStyle);
//				logger.info("当前工人：" + worker.getName() + " 当前列：" + cell.getColumnIndex());
//
//				/***
//				 * 合并单元格
//				 */
//				// 合并序号
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 0, 0));
//				// 合并姓名
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 1, 1));
//				// 合并工号
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 2, 2));
//				// 合并工种
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 3, 3));
//
//				// 合并合计工时
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 1, currentRowCount + 2,
//						leftDateColNumbers + dateList.size() + additionalCols,
//						leftDateColNumbers + dateList.size() + additionalCols));
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 3, currentRowCount + 4,
//						leftDateColNumbers + dateList.size() + additionalCols,
//						leftDateColNumbers + dateList.size() + additionalCols));
//
//				// 合并合计工天
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 1, currentRowCount + 2,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols));
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 3, currentRowCount + 4,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols));
//
//				// 合并工人签名
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5,
//						leftDateColNumbers + dateList.size() + 2 + additionalCols,
//						leftDateColNumbers + dateList.size() + 2 + additionalCols));
//				// 合并备注
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5,
//						leftDateColNumbers + dateList.size() + 3 + additionalCols,
//						leftDateColNumbers + dateList.size() + 3 + additionalCols));
//
//				// 正常开工工时汇总
//				row = sheet1.getRow(currentRowCount + 1);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + additionalCols);
//				cell.setCellValue(formatMinutes2Hours(worker.getWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getWorkingTimes())));
//				cell.setCellStyle(cellStyle);
//
//				// 加班工时汇总
//				row = sheet1.getRow(currentRowCount + 3);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + additionalCols);
//				cell.setCellValue(formatMinutes2Hours(worker.getOtWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getOtWorkingTimes())));
//				cell.setCellStyle(cellStyle);
//
//				// 正常开工工时汇总
//				row = sheet1.getRow(currentRowCount + 1);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + 1 +additionalCols);
//				cell.setCellValue( MathUtil.formatDecimalValue(3, worker.getWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getWorkingDays()));
//				cell.setCellStyle(cellStyle);
//
//				// 加班工时汇总
//				row = sheet1.getRow(currentRowCount + 3);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + 1 + additionalCols);
//				cell.setCellValue( MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()));
//				cell.setCellStyle(cellStyle);
//
//				currentRowCount = currentRowCount + 6;
//
//				// 累计工时
//				// 累计工天
//				totalWorkingTimes += formatMinutes2Hours(worker.getWorkingTimes()) + formatMinutes2Hours(worker.getOtWorkingTimes());
//				totalWorkingDays += worker.getWorkingDays() + worker.getOtWorkingDays();
//			}
//
//			row = sheet1.createRow(4 + count++);
//			row.setHeight((short) 400);
//			cell = row.createCell(0);
//			cell.setCellStyle(cellStyle);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 700);
//			createCells(row,cell, 8 + dateList.size() + addMultyAttendanceGroupCols, cellStyle);
//
//			cell = row.getCell(leftDateColNumbers + addMultyAttendanceGroupCols +dateList.size() - 1);
//			cell.setCellValue("总计");
//			cell.setCellStyle(cellStyle);
//
//			cell = row.getCell(leftDateColNumbers + addMultyAttendanceGroupCols + dateList.size());
//			cell.setCellValue(totalWorkingTimes == 0 ? 0 : MathUtil.formatDecimalValue(1, totalWorkingTimes));
//			cell.setCellStyle(cellStyle);
//
//			cell = row.getCell(leftDateColNumbers + addMultyAttendanceGroupCols + dateList.size() + 1);
//			cell.setCellValue(totalWorkingDays == 0 ? 0 : MathUtil.formatDecimalValue(1, totalWorkingDays));
//			cell.setCellStyle(cellStyle);
//
//		}
//	}
//
//	private String getOTSalaryRule(WorkerDataRecordDTO data) {
//		String rule = null;
//		if (EmodorAttendanceOTSalaryType.NORMAL.getType().equals(data.getOtSalaryRuleCode())) {
//			rule = "正常时薪";
//		} else if (EmodorAttendanceOTSalaryType.HALF_TIMES.getType().equals(data.getOtSalaryRuleCode())) {
//			rule = "半个工";
//
//		} else if (EmodorAttendanceOTSalaryType.ONE_TIME.getType().equals(data.getOtSalaryRuleCode())) {
//			rule = "1个工";
//
//		} else if (EmodorAttendanceOTSalaryType.ONE_POINT_FIVE_TIMES.getType().equals(data.getOtSalaryRuleCode())) {
//			rule = "1.5倍时薪";
//		}
//		  else if (EmodorAttendanceOTSalaryType.HOURS.getType().equals(data.getOtSalaryRuleCode())) {
//			Double hours = data.getHours();
//			if (hours != null) {
//				String hoursStr = String.valueOf(hours);
//				if (hoursStr.indexOf(".0") == -1) {
//					rule = MathUtil.formatDecimalValue(1, hours) + "小时算1个工";
//				}
//				else {
//					rule = hours.intValue() + "小时算1个工";
//				}
//			}
//		}
//		return rule;
//	}
//
//	/**
//	 * 根据班组Id生成考勤工资记录(包含工资)
//	 * @param book
//	 * @param sheetName
//	 * @param groupId
//	 * @param startDate
//	 * @param endDate
//	 */
//	private void createAttendanceSalarySheetByGroupId(XSSFWorkbook book,String waterMarkCompanyLogo, String sheetName, String groupId, String startDate,
//													  String endDate, Map<String, Double> incomeMap, Map<String, WorkerReportDTO> workerReportMap) {
//
//		GroupSalaryReportDTO reportDTO = groupService.getGroupSalaryReport(groupId, startDate, endDate);
//		String laborCompanyName = groupService.getGroupLaborCompanyName(groupId);
//        String contractorName = groupService.getGroupProjectContractorName(groupId);
//        String companyName = groupService.getCompanyNameByGroupId(groupId);
//		List<Date> dateList = new ArrayList<>();
//		DateUtil dateUtil = DateUtil.getInstance();
//		Date sDate = dateUtil.parseToDate2(startDate);
//		Date eDate = dateUtil.parseToDate2(endDate);
//
//		long days = dateUtil.diffDays(eDate, sDate);
//
//		for (int i = 0; i <= days; i++) {
//			Date date = dateUtil.getDateAfter(sDate, i);
//			dateList.add(date);
//		}
//
//		int addMultyAttendanceGroupCols = 0;
//		for (int i = 0; i < dateList.size(); i++) {
//
//			int maxAttendanceGroupCounts = groupService.getMaxAttendanceGroupCountsByGroupIdAndRecordDate(groupId,
//					DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT));
//			// 出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//				addMultyAttendanceGroupCols = addMultyAttendanceGroupCols + maxAttendanceGroupCounts - 1;
//			}
//		}
//
//		String reportName =  "云筑考勤统计表";
//		String createDate = "统计范围："+startDate + " 至 " + endDate+"      制表时间：" + DateUtil.getInstance().getDateTime() + "(北京时间)";
//
//		Sheet sheet1 =  book.createSheet(sheetName);
//
//		XSSFCellStyle title = book.createCellStyle();
//		XSSFFont reportFontFontTitle = book.createFont();
//		reportFontFontTitle.setFontName("黑体");
//		reportFontFontTitle.setFontHeightInPoints((short) 18);// 字号
//		reportFontFontTitle.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		title.setFont(reportFontFontTitle);
//		title.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		title.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		title.setWrapText(true);
//		title.setBorderBottom(BorderStyle.THIN);
//		title.setBorderLeft(BorderStyle.THIN);
//		title.setBorderRight(BorderStyle.THIN);
//		title.setBorderTop(BorderStyle.THIN);
//
//		XSSFCellStyle reportNameStyle = book.createCellStyle();
//		XSSFFont reportFontFont = book.createFont();
//		reportFontFont.setFontName("黑体");
//		reportFontFont.setFontHeightInPoints((short) 8);// 字号
//		reportFontFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		reportNameStyle.setFont(reportFontFont);
//		reportNameStyle.setAlignment(XSSFCellStyle.ALIGN_LEFT);// 左右居中
//		reportNameStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		reportNameStyle.setWrapText(true);
//		reportNameStyle.setBorderBottom(BorderStyle.THIN);
//		reportNameStyle.setBorderLeft(BorderStyle.THIN);
//		reportNameStyle.setBorderRight(BorderStyle.THIN);
//		reportNameStyle.setBorderTop(BorderStyle.THIN);
//
//		XSSFCellStyle style = book.createCellStyle();
//		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
//		XSSFFont titleFont = book.createFont();
//		titleFont.setFontName("黑体");
//		titleFont.setFontHeightInPoints((short) 16);// 字号
//		titleFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		style.setFont(titleFont);
//		style.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		style.setWrapText(true);//自动换行
//		short titleHeigh = 300;
//
//		//        sheet1.setColumnWidth(2, 2048);
//		sheet1.setColumnWidth(0, 600);
//		// style.setRotation(short rotation);//单元格内容的旋转的角度
//		// 设置相应的行（初始从0开始）
//		Row row = sheet1.createRow(0);
//		row.setHeight((short) 880);
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		Cell cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue(reportName);
//		XSSFCellStyle leftStyle = getXssfCellStyle(book,XSSFFont.BOLDWEIGHT_NORMAL,XSSFCellStyle.ALIGN_LEFT);
//
//		cell.setCellStyle(leftStyle);
//		row.setHeight((short) 380);
//
//		// 2022/3/18
//		Cell titleRightCell = createCells(row, cell, 4, leftStyle);
//
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		cell = row.createCell(titleRightCell.getColumnIndex() + 1);
//
//		cell.setCellStyle(title);
//		Cell finalCell = createCells(row, cell, 4 + dateList.size() + addMultyAttendanceGroupCols, title);
//		int topLeftLogoCell = cell.getColumnIndex();
//
//
//		row = sheet1.createRow(1);
//		cell = row.createCell(0);
//		row.setHeight(titleHeigh);
//		cell.setCellValue(createDate);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell, 9 + dateList.size() + addMultyAttendanceGroupCols,reportNameStyle);
//
//		row = sheet1.createRow(2);
//		row.setHeight(titleHeigh);
//		cell = row.createCell(0);
//		cell.setCellValue("项目：" + reportDTO.getProjectName()+"   班组：" + reportDTO.getGroupName()+"   劳务公司：" + (StringUtils.isNotBlank(laborCompanyName) ? laborCompanyName : StringUtils.isNotBlank(contractorName) ? contractorName : companyName));
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell, 9 + dateList.size() + addMultyAttendanceGroupCols,reportNameStyle);
//
//
//		row = sheet1.createRow(3);
//		row.setHeight((short) 1449);
//		cell = row.createCell(0);
//		cell.setCellStyle(reportNameStyle);
//
//
//		//默认是按30分钟算
//		String minutes = "30分钟";
//		if (reportDTO != null) {
//			if (EmodorDataDictConstant.SALARY_TYPE_ONE_MINUTE.equals(reportDTO.getSalaryRule())) {
//				minutes = "1分钟";
//			}
//			else if (EmodorDataDictConstant.SALARY_TYPE_HALF_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "30分钟";
//			}
//			else if (EmodorDataDictConstant.SALART_TYPE_ONE_HOUR.equals(reportDTO.getSalaryRule())) {
//				minutes = "60分钟";
//			}
//		}
//
//		//创建字体
//		XSSFFont ftRed  = book.createFont();
//		ftRed.setColor(HSSFColor.RED.index);
//		ftRed.setFontName("黑体");
//		ftRed.setFontHeightInPoints((short) 8);// 字号
//		ftRed.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		String descripion = "说明:\r\n (1) 出勤标准8h/d表示出勤8个小时算1个工\r\n (2) 工时扣除迟到早退时间\r\n (3) 迟到早退时间取整，最小单位为&minutes&\r\n (4) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//				" \r\n (5) ■管理员修改";
//		if (reportDTO != null && StringUtils.isNotBlank(reportDTO.getSalaryRule()) && reportDTO.getSalaryRule().equals(SalaryRuleType.SALART_TYPE_ONE_CLICK.getType())) {
//			descripion = "说明:\r\n (1) 出勤标准打卡一次算1个工\r\n (2) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//					" \r\n (3) ■管理员修改";
//		}
//		descripion = descripion.replace("&minutes&", minutes);
//		XSSFRichTextString richString = new XSSFRichTextString(descripion);
//		richString.applyFont(descripion.indexOf("■"), descripion.indexOf("■")+1, ftRed);
//		XSSFFont ftB  = book.createFont();
//		ftB.setFontName("黑体");
//		ftB.setFontHeightInPoints((short) 8);// 字号
//		ftB.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		richString.applyFont(descripion.indexOf("■")+1, descripion.length(), ftB);
//		cell.setCellValue(richString);
//		createCells(row,cell, 9 + dateList.size() + addMultyAttendanceGroupCols,reportNameStyle);
//
//
//		XSSFCellStyle cellStyle = book.createCellStyle();
//		cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		cellStyle.setWrapText(true);
//		cellStyle.setBorderBottom(BorderStyle.THIN);
//		cellStyle.setBorderLeft(BorderStyle.THIN);
//		cellStyle.setBorderRight(BorderStyle.THIN);
//		cellStyle.setBorderTop(BorderStyle.THIN);
//		XSSFFont cellFont = book.createFont();
//		cellFont.setFontHeightInPoints((short) 6);// 字号
//		cellStyle.setFont(cellFont);
//
//		//日期左边单元格列数
//		int leftDateColNumbers = 5;
//		row = sheet1.createRow(4);
//		row.setHeight((short) 400);
//		cell = row.createCell(0);
//		cell.setCellValue("序号");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 700);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("姓名");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工号");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工种");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1200);
//
//		Map<Date,Integer> attendanceGroupCountsMap = new HashMap<>();
//		int additionalCols = 0;
//		for (int i = 0; i < dateList.size(); i++) {
//			cell = row.createCell(cell.getColumnIndex() + 1);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//			String dateTime = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_SIMPLEFORMAT3);
//			cell.setCellValue(dateTime.substring(3));
//			cell.setCellStyle(cellStyle);
//
//			int maxAttendanceGroupCounts = groupService.getMaxAttendanceGroupCountsByGroupIdAndRecordDate(groupId, DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT));
//			if (maxAttendanceGroupCounts == 0) {
//				//至少需要创建一列
//				maxAttendanceGroupCounts = 1;
//			}
//			attendanceGroupCountsMap.put(dateList.get(i), maxAttendanceGroupCounts);
//			//出现在同个班组下多个考勤组打卡的情况，按照最多的情况
//			if (maxAttendanceGroupCounts > 1) {
//				int dateCounts = 1;
//				while (dateCounts < maxAttendanceGroupCounts) {
//					cell = row.createCell(cell.getColumnIndex() + 1);
//					sheet1.setColumnWidth(cell.getColumnIndex(), 820);
//					cell.setCellStyle(cellStyle);
//					dateCounts ++;
//				}
//				//合并单元格
//				sheet1.addMergedRegion(new CellRangeAddress(4, 4, 5 + i + additionalCols, 5 + i + additionalCols + maxAttendanceGroupCounts - 1));
//				additionalCols = additionalCols + maxAttendanceGroupCounts - 1;
//			}
//
//		}
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("合计工时(小时)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("合计工天(工)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("出勤工钱(元)");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1120);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工人签名");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 873);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("备注");
//		cell.setCellStyle(cellStyle);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 600);
//
//		//合并单元格
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 0, 4));
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 5, 9 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(1, 1, 0, 9 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(2, 2, 0, 9 + dateList.size() + additionalCols));
//		sheet1.addMergedRegion(new CellRangeAddress(3, 3, 0, 9 + dateList.size() + additionalCols));
//
//		//  2022年3月18日
//		// =================================================
//		fillExcelLogo(book, waterMarkCompanyLogo, sheet1, finalCell,sheet1.getRow(0),topLeftLogoCell);
//		// =================================================
//
//		List<WorkerReportDTO> workerList = reportDTO.getWorkerReportList();
//
//		int number = 1;
//		int count = 1;
//		int currentRowCount = 5;
//		if (workerList != null && !workerList.isEmpty()) {
//			double totalWorkingTimes = 0d;
//			double totalWorkingDays = 0d;
//			double totalPay = 0d;
//			for (WorkerReportDTO worker : workerList) {
//				if(incomeMap.get(worker.getId()) == null){
//					incomeMap.put(worker.getId(), 0.0);
//				}
//				workerReportMap.put(worker.getWorkerId(), worker);
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 1240);
//				cell = row.createCell(0);
//				cell.setCellValue(number++);
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue(worker.getName() + worker.getMobileNumber());
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue(worker.getWorkerCode());
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue(worker.getWorkerCategoryName());
//				cell.setCellStyle(cellStyle);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue("打卡记录");
//				cell.setCellStyle(cellStyle);
//
//				Map<Integer,Integer> dateMap = new HashMap<>();
//				for (int i = 0; i < dateList.size(); i++) {
//					dateMap.put(i, 1);
//					String recordDate = DateUtil.getInstance().dateToString(dateList.get(i));
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						boolean createCell = false;
//						if (data != null) {
//							createCell = true;
//						}
//
//						if (!createCell ) {
//							continue;
//						}
//
//						//创建考勤记录cell
//						cell = row.createCell(cell.getColumnIndex()  + 1);
//						cell.setCellStyle(cellStyle);
//						XSSFRichTextString richString2  = getXSSFRichTextString(data.getTotalRecordList(),book);
//						cell.setCellValue(richString2);
//						//String recordListStr = getAttendanceRecordFormatString(data.getTotalRecordList());
//						//cell.setCellValue(recordListStr);
//					}
//					//额外创建单元格
//					cell = createAdditionalCells(row,cell,workerDataList.size(),attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//
//				}
//				//补齐右边五个单元格
//				createCells(row, cell, 5, cellStyle);
//
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("出勤工时(小时)");
//				cell.setCellStyle(cellStyle);
//
//				//创建工时cell
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						cell.setCellValue(formatMinutes2Hours(data.getWorkingTimes()));
//						cell.setCellStyle(cellStyle);
//					}
//					cell = createAdditionalCells(row,cell,workerDataList.size(),attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//				//补齐右边五个单元格
//				createCells(row, cell, 5, cellStyle);
//
//
//
//				row = sheet1.createRow(4 + count ++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("出勤标准");
//				cell.setCellStyle(cellStyle);
//
//				//创建出勤标准cell
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						if (data.getNormalWorkingTimes() > 0) {
//							cell.setCellValue(formatMinutes2Hours(data.getNormalWorkingTimes()) + "h/d");
//						}
//						cell.setCellStyle(cellStyle);
//					}
//
//					//额外创建单元格
//					cell = createAdditionalCells(row,cell,workerDataList.size(),attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//				createCells(row, cell, 5, cellStyle);
//
//
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("加班工时(小时)");
//				cell.setCellStyle(cellStyle);
//
//				long otWorkingTimesTotal = 0;
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						int otWorkingTimes = data.getOtWorkingTimes();
//						otWorkingTimesTotal += otWorkingTimes;
//						cell.setCellValue(formatMinutes2Hours(otWorkingTimes));
//						cell.setCellStyle(cellStyle);
//
//					}
//					//额外创建单元格
//					cell = createAdditionalCells(row,cell,workerDataList.size(),attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellValue(formatMinutes2Hours(otWorkingTimesTotal));
//				cell.setCellStyle(cellStyle);
//				createCells(row, cell, 4, cellStyle);
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//				cell.setCellValue("加班标准");
//				cell.setCellStyle(cellStyle);
//
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						String rule = this.getOTSalaryRule(data);
//						if (rule != null) {
//							cell.setCellValue(rule);
//						}
//						cell.setCellStyle(cellStyle);
//					}
//					//额外创建单元格
//					cell = createAdditionalCells(row,cell,workerDataList.size(),attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//				}
//
//				cell = createCells(row, cell, 5, cellStyle);
//
//				row = sheet1.createRow(4 + count++);
//				row.setHeight((short) 400);
//				cell = row.createCell(0);
//				cell.setCellStyle(cellStyle);
//				cell = createCells(row, cell, 4, cellStyle);
//
//				/** 3.9.0 调整 **/
//				cell.setCellValue("工资");
//				cell.setCellStyle(cellStyle);
//				for (int i = 0; i < dateList.size(); i++) {
//					String recordDate = DateUtil.getInstance().getDateTime(dateList.get(i), DateUtil.DEFAULT_DATE_FORMAT);
//					List<WorkerDataRecordDTO> workerDataList = worker.getRecordReportMap().get(recordDate);
//					for (WorkerDataRecordDTO data : workerDataList) {
//						cell = row.createCell(cell.getColumnIndex() + 1);
//						if (data.getWorkerDaySalaryRuleSetting() != null) {
//							if (EmodorSalaryType.DAY_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())){
//								cell.setCellValue( data.getWorkerDaySalaryRuleSetting().getSalaryValue() + "元/天");
//							} else if (EmodorSalaryType.MONTH_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())){
//								cell.setCellValue( data.getWorkerDaySalaryRuleSetting().getMonthSalary() + "元/月");
//							} else if (EmodorSalaryType.COUNT_SALARY.getType().equals(data.getWorkerDaySalaryRuleSetting().getSalaryType())){
//								cell.setCellValue("计量");
//							}
//						}
//						cell.setCellStyle(cellStyle);
//					}
//					//额外创建单元格
//					cell = createAdditionalCells(row,cell,workerDataList.size(),attendanceGroupCountsMap.get(dateList.get(i)),cellStyle);
//
//				}
//
//				//右边补齐五个单元格
//				createCells(row, cell, 5, cellStyle);
//
//				logger.info("工人：" + worker.getName() + " 表格当前列:" + cell.getColumnIndex());
//
//				/***
//				 * 合并单元格
//				 */
//				//合并序号
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 0, 0));
//				//合并姓名
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 1, 1));
//				// 合并工号
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 2, 2));
//				// 合并工种
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, 3, 3));
//
//				//合并合计工时
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 1, currentRowCount + 2,
//						leftDateColNumbers + dateList.size() + additionalCols,
//						leftDateColNumbers + dateList.size() + additionalCols));
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 3, currentRowCount + 4,
//						leftDateColNumbers + dateList.size() + additionalCols,
//						leftDateColNumbers + dateList.size() + additionalCols));
//
//				// 合并合计工天
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 1, currentRowCount + 2,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols));
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount + 3, currentRowCount + 4,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols,
//						leftDateColNumbers + dateList.size() + 1 + additionalCols));
//
//				//合并出勤工钱
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, leftDateColNumbers + dateList.size() + 2 + additionalCols, leftDateColNumbers + dateList.size() + 2 + additionalCols));
//				//合并工人签名
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, leftDateColNumbers + dateList.size() + 3 + additionalCols, leftDateColNumbers + dateList.size() + 3 + additionalCols));
//				//合并备注
//				sheet1.addMergedRegion(new CellRangeAddress(currentRowCount, currentRowCount + 5, leftDateColNumbers + dateList.size() + 4 + additionalCols, leftDateColNumbers + dateList.size() + 4 + additionalCols));
//
//				// 正常开工工时汇总
//				row = sheet1.getRow(currentRowCount + 1);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + additionalCols);
//				cell.setCellValue(formatMinutes2Hours(worker.getWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getWorkingTimes())));
//				cell.setCellStyle(cellStyle);
//
//				// 加班工时汇总
//				row = sheet1.getRow(currentRowCount + 3);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + additionalCols);
//				cell.setCellValue(formatMinutes2Hours(worker.getOtWorkingTimes()) == 0 ? 0 : MathUtil.formatDecimalValue(2, formatMinutes2Hours(worker.getOtWorkingTimes())));
//				cell.setCellStyle(cellStyle);
//
//				// 正常开工工时汇总
//				row = sheet1.getRow(currentRowCount + 1);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + 1 +additionalCols);
//				cell.setCellValue( MathUtil.formatDecimalValue(3, worker.getWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getWorkingDays()));
//				cell.setCellStyle(cellStyle);
//
//				// 加班工时汇总
//				row = sheet1.getRow(currentRowCount + 3);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + 1 + additionalCols);
//				cell.setCellValue( MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()) == 0 ? 0 : MathUtil.formatDecimalValue(3, worker.getOtWorkingDays()));
//				cell.setCellStyle(cellStyle);
//
//				//出勤工钱汇总
//				row = sheet1.getRow(currentRowCount);
//				cell = row.getCell(leftDateColNumbers + dateList.size() + 2 + additionalCols);
//				cell.setCellValue(worker.getIncome() + worker.getOtIncome());
//				cell.setCellStyle(cellStyle);
//
//
//
//				double totalMondey = incomeMap.get(worker.getId());
//				totalMondey += worker.getIncome() + worker.getOtIncome();
//				incomeMap.put(worker.getId(), totalMondey);
//
//
//
//				currentRowCount = currentRowCount + 6;
//
//				// 累计工时
//				// 累计工天
//				// 累计工钱
//				totalWorkingTimes += formatMinutes2Hours(worker.getWorkingTimes()) + formatMinutes2Hours(worker.getOtWorkingTimes());
//				totalWorkingDays += worker.getWorkingDays() + worker.getOtWorkingDays();
//				totalPay += worker.getIncome() + worker.getOtIncome();
//			}
//
//			row = sheet1.createRow(4 + count++);
//			row.setHeight((short) 400);
//			cell = row.createCell(0);
//			cell.setCellStyle(cellStyle);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 700);
//			createCells(row,cell, 9 + dateList.size() + addMultyAttendanceGroupCols, cellStyle);
//
//			cell = row.getCell(leftDateColNumbers + dateList.size() - 1);
//			cell.setCellValue("总计");
//			cell.setCellStyle(cellStyle);
//
//			cell = row.getCell(leftDateColNumbers + dateList.size());
//			cell.setCellValue(totalWorkingTimes == 0 ? 0 :  MathUtil.formatDecimalValue(1, totalWorkingTimes));
//			cell.setCellStyle(cellStyle);
//
//			cell = row.getCell(leftDateColNumbers + dateList.size() + 1);
//			cell.setCellValue(totalWorkingDays == 0 ? 0 :  MathUtil.formatDecimalValue(1, totalWorkingDays));
//			cell.setCellStyle(cellStyle);
//
//			cell = row.getCell(leftDateColNumbers + dateList.size() + 2);
//			cell.setCellValue(totalPay == 0 ? 0 :  MathUtil.formatDecimalValue(1, totalPay));
//			cell.setCellStyle(cellStyle);
//		}
//	}
//
//	/**
//	 * 生成银行卡表格
//	 *
//	 * @param book
//	 */
//	private void createBankSheetByWorkerGroupId(XSSFWorkbook book, String waterMarkCompanyLogo,String startDate, String endDate, String workerGroupId,
//			Map<String, Double> incomeMap , Map<String, WorkerReportDTO> workerReportMap) {
//		List<WorkerBankDTO> list = groupService.listWorkerBankInfoByGroupId(workerGroupId);
//
//		WorkerGroupBaseDTO groupDetail = groupService.getGroupBaseInfo(workerGroupId);
//		String laborCompanyName = groupService.getGroupLaborCompanyName(workerGroupId);
//        String contractorName = groupService.getGroupProjectContractorName(workerGroupId);
//        String companyName = groupService.getCompanyNameByGroupId(workerGroupId);
//		String sheetName = "工资分配表";
//		Sheet sheet1 =  book.createSheet(sheetName);
//		book.setSheetOrder(sheetName, 0);
//
//
//		List<Date> dateList = new ArrayList<>();
//		DateUtil dateUtil = DateUtil.getInstance();
//		Date sDate = dateUtil.parseToDate2(startDate);
//		Date eDate = dateUtil.parseToDate2(endDate);
//
//		long days = dateUtil.diffDays(eDate, sDate);
//
//		for (int i = 0; i <= days; i++) {
//			Date date = dateUtil.getDateAfter(sDate, i);
//			dateList.add(date);
//		}
//		String reportName =  "云筑工资分配表";
//		String createDate = "统计范围："+startDate + " 至 " + endDate+"      制表时间：" + DateUtil.getInstance().getDateTime() + "(北京时间)";
//
//		XSSFCellStyle title = book.createCellStyle();
//		XSSFFont reportFontFontTitle = book.createFont();
//		reportFontFontTitle.setFontName("黑体");
//		reportFontFontTitle.setFontHeightInPoints((short) 18);// 字号
//		reportFontFontTitle.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		title.setFont(reportFontFontTitle);
//		title.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		title.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		title.setWrapText(true);
//		title.setBorderBottom(BorderStyle.THIN);
//		title.setBorderLeft(BorderStyle.THIN);
//		title.setBorderRight(BorderStyle.THIN);
//		title.setBorderTop(BorderStyle.THIN);
//
//
//		XSSFCellStyle reportNameStyle = book.createCellStyle();
//		XSSFFont reportFontFont = book.createFont();
//		reportFontFont.setFontName("黑体");
//		reportFontFont.setFontHeightInPoints((short) 8);// 字号
//		reportFontFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		reportNameStyle.setFont(reportFontFont);
//		reportNameStyle.setAlignment(XSSFCellStyle.ALIGN_LEFT);// 左右居中
//		reportNameStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		reportNameStyle.setWrapText(true);
//		reportNameStyle.setBorderBottom(BorderStyle.THIN);
//		reportNameStyle.setBorderLeft(BorderStyle.THIN);
//		reportNameStyle.setBorderRight(BorderStyle.THIN);
//		reportNameStyle.setBorderTop(BorderStyle.THIN);
//
//		short titleHeigh = 300;
//
//		sheet1.setColumnWidth(2, 2048);
//		// style.setRotation(short rotation);//单元格内容的旋转的角度
//		// 设置相应的行（初始从0开始）
//		Row row = sheet1.createRow(0);
//		row.setHeight((short) 880); // TODO: 2022/3/18 可优化
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		Cell cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue(reportName);
//		cell.setCellStyle(title);
//		Cell titleRightCell = createCells(row, cell, 10, reportNameStyle);
//		sheet1.setColumnWidth(0, 600);
//		row.setHeight((short) 380);
//
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		cell = row.createCell(titleRightCell.getColumnIndex() + 1);
//
//		cell.setCellStyle(title);
//		Cell finalCell = createCells(row, cell, 9, title);
//
//		fillExcelLogo(book,waterMarkCompanyLogo,sheet1,finalCell,row,cell.getColumnIndex() );
//
//
//
//
//		row = sheet1.createRow(1);
//		cell = row.createCell(0);
//		row.setHeight(titleHeigh);
//		cell.setCellValue(createDate);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell, 20,reportNameStyle);
//
//		row = sheet1.createRow(2);
//		row.setHeight(titleHeigh);
//		cell = row.createCell(0);
//		cell.setCellValue("项目：" + groupDetail.getProjectName()+"   班组：" + groupDetail.getGroupName()+"   劳务公司：" + (StringUtils.isNotBlank(laborCompanyName) ? laborCompanyName : StringUtils.isNotBlank(contractorName) ? contractorName : companyName));
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell,20,reportNameStyle);
//
//
//		row = sheet1.createRow(3);
//		row.setHeight((short) 1449);
//		cell = row.createCell(0);
//		cell.setCellStyle(reportNameStyle);
//
//
//		//默认是按30分钟算
//		String salaryTypeCode = EmodorDataDictConstant.SALARY_TYPE_HALF_HOUR;
//		GroupSalaryTypeDTO salaryTypeDTO = groupService.getGroupSalaryType(workerGroupId);
//		if (salaryTypeDTO != null) {
//			salaryTypeCode = salaryTypeDTO.getSalaryTypeCode();
//		}
//		String minutes = "30分钟";
//		if (salaryTypeCode != null) {
//			if (EmodorDataDictConstant.SALARY_TYPE_ONE_MINUTE.equals(salaryTypeCode)) {
//				minutes = "1分钟";
//			}
//			else if (EmodorDataDictConstant.SALARY_TYPE_HALF_HOUR.equals(salaryTypeCode)) {
//				minutes = "30分钟";
//			}
//			else if (EmodorDataDictConstant.SALART_TYPE_ONE_HOUR.equals(salaryTypeCode)) {
//				minutes = "60分钟";
//			}
//		}
//
//
//		//创建字体
//		XSSFFont ftRed = book.createFont();
//		ftRed.setColor(HSSFColor.RED.index);
//		ftRed.setFontName("黑体");
//		ftRed.setFontHeightInPoints((short) 8);// 字号
//		ftRed.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		String descripion = "说明:\r\n (1) 出勤标准8h/d表示出勤8个小时算1个工\r\n (2) 工时扣除迟到早退时间\r\n (3) 迟到早退时间取整，最小单位为&minutes&\r\n (4) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//				" \r\n (5) ■管理员修改";
//		if (StringUtils.isNotBlank(salaryTypeCode) && salaryTypeCode.equals(SalaryRuleType.SALART_TYPE_ONE_CLICK.getType())) {
//			descripion = "说明:\r\n (1) 出勤标准打卡一次算1个工\r\n (2) 若工人当天在多个考勤组考勤，则该工人当天的考勤记录分多列显示" +
//					" \r\n (3) ■管理员修改";
//		}
//		descripion = descripion.replace("&minutes&", minutes);
//		XSSFRichTextString richString = new XSSFRichTextString(descripion);
//		richString.applyFont(descripion.indexOf("■"), descripion.indexOf("■") + 1, ftRed);
//		XSSFFont ftB = book.createFont();
//		ftB.setFontName("黑体");
//		ftB.setFontHeightInPoints((short) 8);// 字号
//		ftB.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		richString.applyFont(descripion.indexOf("■") + 1, descripion.length(), ftB);
//		cell.setCellValue(richString);
//
//
//
//		createCells(row,cell, 20,reportNameStyle);
//
//		//合并单元格
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 0, 10));
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 11, 20));
//		sheet1.addMergedRegion(new CellRangeAddress(1, 1, 0, 20));
//		sheet1.addMergedRegion(new CellRangeAddress(2, 2, 0, 20));
//		sheet1.addMergedRegion(new CellRangeAddress(3, 3, 0, 20));
//
//		XSSFCellStyle style = book.createCellStyle();
//		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
//		XSSFFont titleFont = book.createFont();
//		titleFont.setFontName("黑体");
//		titleFont.setFontHeightInPoints((short) 8);// 字号
//		titleFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		style.setFont(titleFont);
//		style.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		style.setWrapText(true);
//		style.setBorderBottom(BorderStyle.THIN);
//		style.setBorderLeft(BorderStyle.THIN);
//		style.setBorderRight(BorderStyle.THIN);
//		style.setBorderTop(BorderStyle.THIN);
//
//		row = sheet1.createRow(4);
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		row.setHeight((short)900);
////		row.setRowStyle(style);
//
//		cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue("序号");
//		cell.setCellStyle(style);
//		createCells(row,cell, 20,style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 600);
//
//		cell = row.createCell(1);
//		cell.setCellValue("姓名");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1490);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工号");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1490);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工种");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1490);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("身份证号");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 3637);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("手机号");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 2328);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("入场时间");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 2328);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("退场时间");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 2328);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("银行卡号");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 4042);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("持卡人");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1490);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("开户行");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 2328);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("省份");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1490);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("市县");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1490);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("平均日薪(元/天)");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1600);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("总工天");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1600);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("总工钱(元)");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1600);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("借支(元)");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1600);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("奖励(元)");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1600);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("应发工钱(元)");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1600);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("工人确认");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 2328);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("备注");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1455);
//
//		int count = 4;
//		int orderNumber = 1;
//		if (list != null && !list.isEmpty()) {
//			double totalPay = 0d;
//			for (WorkerBankDTO dto : list) {
//				if (!incomeMap.containsKey(dto.getWorkerId())) {
//					continue;
//				}
//				row = sheet1.createRow(++count);
////				row.setRowStyle(style);
//				row.setHeight((short)1100);
//				cell = row.createCell(0);
//				cell.setCellStyle(style);
//				cell.setCellValue(orderNumber++);
//				createCells(row, cell, 20,style);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getName());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getWorkerCode());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(workerReportMap.get(dto.getWorkerId()) != null ? workerReportMap.get(dto.getWorkerId()).getWorkerCategoryName() : "");
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getIdCard());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getMobile());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				if(dto.getJoinDate() != null) {
//					cell.setCellValue(DateUtil.getInstance().dateToString(dto.getJoinDate()).replaceAll("-", "."));
//				}
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				if(dto.getExitDate() != null) {
//					cell.setCellValue(DateUtil.getInstance().dateToString(dto.getExitDate()).replaceAll("-", "."));
//				}
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getCardNumber());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getCardName());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getBankName());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getProvince());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getCity());
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				double averageDaySalary = 0d;
//				double workingDays = 0d;
//				double pay = 0;
//
//				if (workerReportMap.get(dto.getWorkerId()) != null) {
//					pay = workerReportMap.get(dto.getWorkerId()).getIncome() +  workerReportMap.get(dto.getWorkerId()).getOtIncome();
//					workingDays = workerReportMap.get(dto.getWorkerId()).getWorkingDays() + workerReportMap.get(dto.getWorkerId()).getOtWorkingDays();
//					if (workingDays != 0) {
//						averageDaySalary = pay / workingDays;
//					} else {
//						averageDaySalary = pay;
//					}
//				}
//				totalPay = totalPay + pay;
//				cell.setCellValue(averageDaySalary == 0 ? 0 :  MathUtil.formatDecimalValue(0, averageDaySalary));
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(workerReportMap.get(dto.getWorkerId()) != null ?
//						workerReportMap.get(dto.getWorkerId()).getWorkingDays() + workerReportMap.get(dto.getWorkerId()).getOtWorkingDays() : 0);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(incomeMap.get(dto.getId()) == null ? 0 : incomeMap.get(dto.getId()));
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue("");
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(incomeMap.get(dto.getId()) == null ? 0 : incomeMap.get(dto.getId()));
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//			}
//
//			row = sheet1.createRow(++count);
//			// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//			row.setHeight((short)900);
////			row.setRowStyle(style);
//
//			cell = row.createCell(0);
//			// 写入相关数据到设置的行列中去。
//			cell.setCellStyle(style);
//			createCells(row,cell, 20,reportNameStyle);
//			sheet1.setColumnWidth(cell.getColumnIndex(), 600);
//
//			cell = row.getCell(17);
//			cell.setCellValue("合计");
//			cell.setCellStyle(style);
//
//			cell = row.getCell(18);
//			cell.setCellValue(totalPay != 0 ? MathUtil.formatDecimalValue(1, totalPay) : 0);
//			cell.setCellStyle(style);
//		}
//	}
//
//
//
//	private void createProjectAttendanceSheet(XSSFWorkbook book, String string, ProjectAttendanceQueryDTO queryDTO,
//			String companyId, Map<String, Double> incomeMap, SysUserDTO user) {
//		List<ProjectAttendanceStatisticsDTO> list = new ArrayList<>();
//		list = attendanceService.listProjectAttendanceStatisticsForExcel(queryDTO, companyId, user);
//
//		String sheetName = "项目概况表";
//		Sheet sheet1 =  book.createSheet(sheetName);
//		book.setSheetOrder(sheetName, 0);
//
//		String reportName = "项目概况";
//		String createDate = "报表生成时间：北京时间" + DateUtil.getInstance().getDateTime();
//
//		// 报头 样式1
//		XSSFCellStyle reportNameStyle = book.createCellStyle();
//		XSSFFont reportFontFont = book.createFont();
//		reportFontFont.setFontName("黑体");
//		reportFontFont.setFontHeightInPoints((short) 11);// 字号
//		reportFontFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		reportNameStyle.setFont(reportFontFont);
//		reportNameStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		reportNameStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		reportNameStyle.setWrapText(true);
//		reportNameStyle.setBorderBottom(BorderStyle.THIN);
//		reportNameStyle.setBorderLeft(BorderStyle.THIN);
//		reportNameStyle.setBorderRight(BorderStyle.THIN);
//		reportNameStyle.setBorderTop(BorderStyle.THIN);
//
//		// excel文件 样式2
//		XSSFCellStyle style = book.createCellStyle();
//		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
//		XSSFFont titleFont = book.createFont();
//		titleFont.setFontName("黑体");
//		titleFont.setFontHeightInPoints((short) 9);// 字号
//		//titleFont.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);// 加粗
//		style.setFont(titleFont);
//		style.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 左右居中
//		style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 上下居中
//		style.setWrapText(true);
//		style.setBorderBottom(BorderStyle.THIN);
//		style.setBorderLeft(BorderStyle.THIN);
//		style.setBorderRight(BorderStyle.THIN);
//		style.setBorderTop(BorderStyle.THIN);
//
//		short titleHeigh = 800;
//
//		sheet1.setColumnWidth(2, 2048);
//		// style.setRotation(short rotation);//单元格内容的旋转的角度
//		// 设置相应的行（初始从0开始）
//		Row row = sheet1.createRow(0);
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		Cell cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue(reportName);
//		cell.setCellStyle(reportNameStyle);
//		createCells(row,cell, 13,reportNameStyle);
//		sheet1.setColumnWidth(0, 600);
//		row.setHeight((short) 600);
//
//		row = sheet1.createRow(1);
//		cell = row.createCell(0);
//		row.setHeight((short)300);
//		cell.setCellValue(createDate);
//		cell.setCellStyle(style);
//		createCells(row,cell, 13,style);
//
//
//		//合并单元格
//		sheet1.addMergedRegion(new CellRangeAddress(0, 0, 0, 13));
//		sheet1.addMergedRegion(new CellRangeAddress(1, 1, 0, 13));
//
//		row = sheet1.createRow(2);
//		// 在所在的行设置所在的单元格（相当于列，初始从0开始,对应的就是A列）
//		row.setHeight((short)600);
//		row.setRowStyle(style);
//
//		cell = row.createCell(0);
//		// 写入相关数据到设置的行列中去。
//		cell.setCellValue("序号");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1000);
//
//		cell = row.createCell(1);
//		cell.setCellValue("单位");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 4750);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("分公司");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 4750);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("项目名称");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 7600);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("创建日期");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 2660);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("完工日期");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 2660);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("劳务班组数量");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("累计进场人数");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("在场人数");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("近7日出勤率");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("今日出勤率");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("今日出勤人数");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("今日迟到早退");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		cell = row.createCell(cell.getColumnIndex() + 1);
//		cell.setCellValue("今日未打卡");
//		cell.setCellStyle(style);
//		sheet1.setColumnWidth(cell.getColumnIndex(), 1615);
//
//		int count = 2;
//		int orderNumber = 1;
//		if (list != null && !list.isEmpty()) {
//			for (ProjectAttendanceStatisticsDTO dto : list) {
//				row = sheet1.createRow(++count);
//				row.setRowStyle(style);
//				row.setHeight((short)600);
//				// 序号
//				cell = row.createCell(0);
//				cell.setCellStyle(style);
//				cell.setCellValue(orderNumber++);
//
//				// 单位
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getParentCompanyName());
//
//				// 分公司
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getCompanyName());
//
//				// 项目名称
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getProjectName());
//
//				// 创建日期
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(DateUtil.getInstance().getDateTime(dto.getCreatedTime(), DateUtil.DEFAULT_DATE_FORMAT));
//
//				// 完工日期
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				if (dto != null && dto.getEndTime()!=null) {
//					cell.setCellValue(DateUtil.getInstance().getDateTime(dto.getEndTime(), DateUtil.DEFAULT_DATE_FORMAT));
//				} else {
//					cell.setCellValue("");
//				}
//
//
//				// 劳务班组数
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getGroupCounts());
//
//				// 累计进场人数
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getJoinCounts());
//
//				// 在场人数
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getPresentCounts());
//
//				// 近7日出勤率
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				if (dto.getAttendanceCounts7Days() > 0 && dto.getPresentCounts7Days() == 0) {
//					cell.setCellValue("100%");
//				} else if(dto.getAttendanceCounts7Days() == 0 && dto.getPresentCounts7Days() == 0) {
//					cell.setCellValue("0%");
//				} else {
//					double attendanceRate7DaysCount = Math.round((double)dto.getAttendanceCounts7Days() * 100 / (double)dto.getPresentCounts7Days());
//					if (attendanceRate7DaysCount > 100) {
//						cell.setCellValue("100%");
//					} else {
//						cell.setCellValue(Math.round((double)dto.getAttendanceCounts7Days() * 100 / (double)dto.getPresentCounts7Days()) + "%");
//					}
//				}
//
//
//				// 今日出勤率
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				if (dto.getAttendanceCounts() > 0 && dto.getPresentCounts() == 0) {
//					cell.setCellValue("100%");
//				} else if(dto.getAttendanceCounts() == 0 && dto.getPresentCounts() == 0) {
//					cell.setCellValue("0%");
//				} else {
//					double attendanceRate = Math.round((double)dto.getAttendanceCounts() * 100 / (double)dto.getPresentCounts());
//					if (attendanceRate > 100) {
//						cell.setCellValue("100%");
//					} else {
//						cell.setCellValue(Math.round((double)dto.getAttendanceCounts() * 100 / (double)dto.getPresentCounts()) + "%");
//					}
//				}
//
//
//				// 今日出勤人数
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getAttendanceCounts());
//
//				// 今日迟到早退
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getLateOrEarlyCounts());
//
//				// 今日未打卡
//				cell = row.createCell(cell.getColumnIndex() + 1);
//				cell.setCellStyle(style);
//				cell.setCellValue(dto.getUnpunchCounts());
//			}
//
//		}
//	}
//
//
//
//	/**
//	 * 生成公司概况数据统计Excel
//	 * @param startDate
//	 * @param endDate
//	 * @param companyId
//	 * @param dataType
//	 * @param output
//	 * @param fileName
//	 */
//	public void generateCompanySummaryExcel(String startDate, String endDate, String companyId, String dataType, String output, String fileName) {
//		long start = System.currentTimeMillis();
//		XSSFWorkbook book = new XSSFWorkbook();
//
//		boolean isMultiDay = StringUtils.isNotBlank(endDate) && !startDate.equals(endDate);
//
//		// 固定表头内容
//		CompanyBaseDTO companyBase = companyService.fetchByCompanyId(companyId);
//		StringBuilder reportName = new StringBuilder(companyBase.getName());
//		reportName.append("（").append(startDate);
//		if (isMultiDay) {
//			reportName.append(" 至 ").append(endDate);
//		}
//		reportName.append("）");
//
//		// 出勤数据统计结果
//		PeriodDataTrendDTO periodDataTrendDTO;
//		if (isMultiDay) {
//			if (EmodorCompanyDataType.CHILD_COMPANYS.getType().equals(dataType)) {
//				periodDataTrendDTO = companyAttendanceService.getOrgCompanyAttendanceSummaryIncludeSubContrators(companyId, startDate, endDate);
//			} else {
//				periodDataTrendDTO = companyAttendanceService.getCompanyAttendanceSummaryIncludeSubContrators(companyId, startDate, endDate);
//			}
//		} else {
//			WorkerSummaryDTO workerSummaryDTO;
//			if (EmodorCompanyDataType.CHILD_COMPANYS.getType().equals(dataType)) {
//				workerSummaryDTO = companyService.getCompanyOrgAttendanceSummaryIncludeSubcontracts(companyId, startDate);
//			} else {
//				workerSummaryDTO = companyAttendanceService.getCompanyAttendanceSummaryIncludeSubcontracts(companyId, startDate);
//			}
//			periodDataTrendDTO = new PeriodDataTrendDTO();
//			periodDataTrendDTO.setAttendanceCounts((int)workerSummaryDTO.getAttendanceCounts());
//			periodDataTrendDTO.setPresentCounts((int)workerSummaryDTO.getPresentCounts());
//			periodDataTrendDTO.setLateOrEarlyCounts((int)workerSummaryDTO.getLateEarlyCounts());
//			periodDataTrendDTO.setLeaveCounts((int)workerSummaryDTO.getLeaveCounts());
//			periodDataTrendDTO.setJoinCounts((int)workerSummaryDTO.getJoinCoutns());
//			periodDataTrendDTO.setExitCounts((int)workerSummaryDTO.getExitCounts());
//		}
//
//		// 出勤数据分布情况
//		List<CompanyDayDataPairDTO> attendanceDetailList;
//		if (isMultiDay) {
//			if (EmodorCompanyDataType.CHILD_COMPANYS.getType().equals(dataType)) {
//				attendanceDetailList = companyAttendanceService.listOrgCompanyDayTrendIncludeSubcontracts(companyId, EmodorProjectDayTrendType.ATTENDANCE.getType(), startDate, endDate);
//			} else {
//				attendanceDetailList = companyAttendanceService.listCompanyDayTrendIncludeSubcontracts(companyId, EmodorProjectDayTrendType.ATTENDANCE.getType(), startDate, endDate);
//			}
//		} else {
//			if (EmodorCompanyDataType.CHILD_COMPANYS.getType().equals(dataType)) {
//				attendanceDetailList = companyAttendanceService.listOrgCompanyAttTrendMultiDayIncludeSubcontract(companyId, startDate, startDate);
//			} else {
//				attendanceDetailList = companyAttendanceService.listCompanyAttTrendMultiDayIncludeSubcontract(companyId, startDate, startDate);
//			}
//		}
//
//		// 项目省市分布情况
//		List<CompanyDayDataPairDTO> projectDistributionList;
//		if (EmodorCompanyDataType.CHILD_COMPANYS.getType().equals(dataType)) {
//			projectDistributionList = projectDistributionsService.getCurrentAttProjectDistributionIncludeSubCompany(companyId, startDate,  endDate);
//		} else {
//			projectDistributionList = projectDistributionsService.getCurrentAttProjectDistribution(companyId, startDate,  endDate);
//		}
//
//		// 项目劳务费用
//		List<ProjectCostDTO> projectCostList;
//		if (EmodorCompanyDataType.CHILD_COMPANYS.getType().equals(dataType)) {
//			projectCostList = companyCostService.listOrgCompanyBuildingProjectCostIncludeSubcontracts(companyId, startDate, endDate);
//		} else {
//			projectCostList = companyCostService.listCompanyBuildingProjectCostIncludeSubcontracts(companyId, startDate, endDate);
//		}
//
//		ExportCompanySummary exportCompanySummary = new ExportCompanySummary();
//		book = exportCompanySummary.createCompanyAttendanceDetailSheet(book, reportName.toString(), periodDataTrendDTO, isMultiDay);
//		book = exportCompanySummary.createCompanyAttendanceDetailSheet(book, reportName.toString(), attendanceDetailList, isMultiDay);
//		book = exportCompanySummary.createCompanyProjectDistributeSheet(book, reportName.toString(), projectDistributionList);
//		book = exportCompanySummary.createCompanyProjectCostSheet(book, reportName.toString(), projectCostList);
//
//		File newFile = new File(output + fileName);
//		try {
//			FileOutputStream fos = new FileOutputStream(newFile);
//			book.write(fos);
//			fos.flush();
//			fos.close();
//		}catch(Exception e) {
//			logger.error("生成公司概况表失败",e);
//		}
//
//		long end = System.currentTimeMillis();
//		logger.info("完成生成公司概况表时间:------------------------" + (end - start)/1000 + "秒");
//	}
//
//	public void generateProjectSummaryExcel(String startDate, String endDate, String projectId, String output, String fileName, SysUserDTO user) {
//		long start = System.currentTimeMillis();
//		XSSFWorkbook book = new XSSFWorkbook();
//		ExportProjectSummary exportProjectSummaryHelper = new ExportProjectSummary();
//
//		WorkerSummaryDTO summaryDTO = null;
//		PeriodDataTrendDTO periodDataTrendDTO = null;
//		List<CompanyDayDataPairDTO> dayTrendList = null;
//		ProjectBaseDTO projectBaseDTO = projectService.getProjectBaseByProjectId(projectId);
//
//		boolean sameDay = false;
//		if (startDate.equals(endDate)){
//			sameDay = true;
//		}
//
//		Date sDate = DateUtil.getInstance().parseToDate2(startDate);
//		Date eDate = DateUtil.getInstance().parseToDate2(endDate);
//
//		long days = DateUtil.getInstance().diffDays(eDate, sDate);
//
//		boolean isOver60Days = false;
//		if (startDate.equals(endDate)){
//			sameDay = true;
//		}
//		if (days >= 60){
//			isOver60Days = true;
//		}
//		if (sameDay){
//			summaryDTO = projectDashboardService.getOrgProjectWorkerAttendanceDetails(projectId, startDate);
//		} else{
//			periodDataTrendDTO = projectDashboardService.getOrgProjectMultiDayDataStatis(projectId, startDate, endDate);
//		}
//		if (sameDay){
//			dayTrendList = projectDashboardService.listOrgProjectAttTrendMultiDay(projectId, startDate, endDate);
//		} else{
//			dayTrendList = projectDashboardService.listOrgProjectDayTrendByType(projectId, "02",  startDate,  endDate);
//		}
//
//		List<GroupAttendanceDTO> groups = projectDashboardService.listOrgProjectGroupsAttendanceDetails(projectId, startDate, endDate, "01", "02");
//		List<CategoryAttendanceDTO> categories = projectDashboardService.listOrgProjectCategoryAttendanceDetails(projectId, startDate, endDate, "01", "02");
//
//		List<ProjectCostTrendDTO> list = new ArrayList<>();
//		List<KeyValueForDate> spliptDateList = new ArrayList<>();
//
//		if (isOver60Days){
//			list = projectCostService.listOrgProjectCostTrendsByMonth(projectId, startDate, endDate);
//			spliptDateList = com.emodor.attendance.utils.DateUtil.getInstance().getKeyValueForDate(startDate, endDate);
//		} else{
//			list = projectCostService.listOrgProjectCostTrendsByDay(projectId, startDate, endDate);
//		}
//
//		List<ProjectCostAndWorkingDaysDTO> projectCostAndWorkingDaysDTOS = projectCostService.listOrgProjectCostAndWorkingDays(projectId,startDate, endDate, user);
//		List<WorkerCategoryCostAndWorkingDaysDTO> categoryCostAndWorkingDaysDTOS = projectCostService.listOrgProjectCategoriesCostAndWorkingDays(projectId,startDate, endDate, user);
//		List<GroupCostAndWorkingDaysDTO> groupCostAndWorkingDaysDTOS = projectCostService.listOrgProjectGroupsCostAndWorkingDays(projectId,startDate, endDate, user);
//
//
//		book = exportProjectSummaryHelper.createProjectSummarySheets(book, summaryDTO, periodDataTrendDTO, projectBaseDTO, startDate, endDate, projectId);
//		book = exportProjectSummaryHelper.createProjectAttendanceSheets(book, dayTrendList, projectBaseDTO, startDate, endDate, projectId);
//		book = exportProjectSummaryHelper.createProjectGroupsSheets(book, groups, projectBaseDTO, startDate, endDate, projectId);
//		book = exportProjectSummaryHelper.createProjectCategorySheets(book, categories, projectBaseDTO, startDate, endDate, projectId);
//		book = exportProjectSummaryHelper.createProjectCostSheets(book, list, spliptDateList, projectBaseDTO, startDate, endDate, projectId);
//		book = exportProjectSummaryHelper.createProjectCostDetailSheets(book, projectCostAndWorkingDaysDTOS, categoryCostAndWorkingDaysDTOS, groupCostAndWorkingDaysDTOS, projectBaseDTO, startDate, endDate, projectId);
//
//		File newFile = new File(output + fileName);
//		try {
//			FileOutputStream fos = new FileOutputStream(newFile);
//			book.write(fos);
//			fos.flush();
//			fos.close();
//		}catch(Exception e) {
//			logger.error("生成项目概况数据表失败",e);
//		}
//
//
//		long end = System.currentTimeMillis();
//		logger.info("完成生成项目概况数据表时间:------------------------" + (end - start)/1000 + "秒");
//	}
//
//}
